Update app.py
Browse files
app.py
CHANGED
@@ -94,7 +94,7 @@ model = AutoModelForSeq2SeqLM.from_pretrained('hackathon-pln-es/t5-small-spanish
|
|
94 |
tokenizer = AutoTokenizer.from_pretrained('hackathon-pln-es/t5-small-spanish-nahuatl')
|
95 |
|
96 |
def predict(input):
|
97 |
-
input_ids = tokenizer('translate Spanish to Nahuatl: ' + input
|
98 |
outputs = model.generate(input_ids, max_length=512)
|
99 |
outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
100 |
return outputs
|
|
|
94 |
tokenizer = AutoTokenizer.from_pretrained('hackathon-pln-es/t5-small-spanish-nahuatl')
|
95 |
|
96 |
def predict(input):
|
97 |
+
input_ids = tokenizer('translate Spanish to Nahuatl: ' + input, return_tensors='pt').input_ids
|
98 |
outputs = model.generate(input_ids, max_length=512)
|
99 |
outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
100 |
return outputs
|