Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,10 +9,9 @@ text_input = gr.TextArea(label="جمله انگلیسی",text_align="left",rtl=T
|
|
9 |
text_output = gr.TextArea(label="ترجمه فارسی",text_align="right",rtl=True,type="text")
|
10 |
|
11 |
def Translate(text, **generator_args):
|
12 |
-
input_ids = tokenizer.encode(
|
13 |
res = model.generate(input_ids, **generator_args)
|
14 |
output = tokenizer.batch_decode(res, skip_special_tokens=True)
|
15 |
-
print(output)
|
16 |
return output
|
17 |
|
18 |
iface = gr.Interface(fn=Translate, inputs=text_input, outputs=text_output)
|
|
|
9 |
text_output = gr.TextArea(label="ترجمه فارسی",text_align="right",rtl=True,type="text")
|
10 |
|
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)
|