SeyedAli commited on
Commit
03c49bc
1 Parent(s): 126e823

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -11,7 +11,7 @@ text_output = gr.TextArea(label="ترجمه انگلیسی",text_align="left",rt
11
  def Translate(text, **generator_args):
12
  input_ids = tokenizer.encode(text, return_tensors="pt")
13
  res = model.generate(input_ids, **generator_args)
14
- output = tokenizer.batch_decode(res, skip_special_tokens=True)
15
  return output
16
 
17
  iface = gr.Interface(fn=Translate, inputs=text_input, outputs=text_output)
 
11
  def Translate(text, **generator_args):
12
  input_ids = tokenizer.encode(text, return_tensors="pt")
13
  res = model.generate(input_ids, **generator_args)
14
+ output = tokenizer.batch_decode(res, skip_special_tokens=True)[0]
15
  return output
16
 
17
  iface = gr.Interface(fn=Translate, inputs=text_input, outputs=text_output)