Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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)
|