Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ def translate(text):
|
|
| 9 |
input = tokenizer(text, return_tensors="pt")
|
| 10 |
output = model.generate(input["input_ids"], max_length=40, num_beams=4, early_stopping=True)
|
| 11 |
|
| 12 |
-
return tokenizer.decode(output[0])
|
| 13 |
|
| 14 |
title = "Spanish to Quechua translation"
|
| 15 |
inputs = gr.inputs.Textbox(lines=1, label="Text in Spanish")
|
|
|
|
| 9 |
input = tokenizer(text, return_tensors="pt")
|
| 10 |
output = model.generate(input["input_ids"], max_length=40, num_beams=4, early_stopping=True)
|
| 11 |
|
| 12 |
+
return tokenizer.decode(output[0], skip_special_tokens=True)
|
| 13 |
|
| 14 |
title = "Spanish to Quechua translation"
|
| 15 |
inputs = gr.inputs.Textbox(lines=1, label="Text in Spanish")
|