Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ text2text_tkn= T5Tokenizer.from_pretrained("t5-small")
|
|
| 5 |
mdl = T5ForConditionalGeneration.from_pretrained("t5-small")
|
| 6 |
|
| 7 |
def text2text_translation(text):
|
| 8 |
-
inp = "translate English to
|
| 9 |
enc = text2text_tkn(inp, return_tensors="pt")
|
| 10 |
tokens = mdl.generate(**enc)
|
| 11 |
response=text2text_tkn.batch_decode(tokens)
|
|
|
|
| 5 |
mdl = T5ForConditionalGeneration.from_pretrained("t5-small")
|
| 6 |
|
| 7 |
def text2text_translation(text):
|
| 8 |
+
inp = "translate English to French:: "+text
|
| 9 |
enc = text2text_tkn(inp, return_tensors="pt")
|
| 10 |
tokens = mdl.generate(**enc)
|
| 11 |
response=text2text_tkn.batch_decode(tokens)
|