Update app.py
Browse files
app.py
CHANGED
@@ -50,9 +50,9 @@ def wingpt(model_name, sl, tl, input_text):
|
|
50 |
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
51 |
]
|
52 |
print(tokenizer.batch_decode(generated_ids, skip_special_tokens=True))
|
53 |
-
|
54 |
-
|
55 |
-
return result
|
56 |
|
57 |
# App layout
|
58 |
st.header("Text Machine Translation")
|
|
|
50 |
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
51 |
]
|
52 |
print(tokenizer.batch_decode(generated_ids, skip_special_tokens=True))
|
53 |
+
rawresult = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
54 |
+
result = rawresult.split('\n')[-1].strip() if '\n' in rawresult else rawresult.strip()
|
55 |
+
return result
|
56 |
|
57 |
# App layout
|
58 |
st.header("Text Machine Translation")
|