AriusXi commited on
Commit
f3cf0ce
·
1 Parent(s): 34d71e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,12 +5,12 @@ 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 Portuguese:: "+text
9
  enc = text2text_tkn(inp, return_tensors="pt")
10
  tokens = mdl.generate(**enc)
11
  response=text2text_tkn.batch_decode(tokens)
12
  return response
13
 
14
  para=grad.Textbox(lines=1, label="English Text", placeholder="Text in English")
15
- out=grad.Textbox(lines=1, label="Portuguese Translation")
16
  grad.Interface(text2text_translation, inputs=para, outputs=out).launch()
 
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)
12
  return response
13
 
14
  para=grad.Textbox(lines=1, label="English Text", placeholder="Text in English")
15
+ out=grad.Textbox(lines=1, label="French Translation")
16
  grad.Interface(text2text_translation, inputs=para, outputs=out).launch()