Spaces:
Runtime error
Runtime error
fvwjtemlfmyztvgzla
commited on
Commit
·
cfba493
1
Parent(s):
204c76a
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def fn(text):
|
|
12 |
tokenizer.tgt_lang = "en"
|
13 |
encoded_zh = tokenizer(text, return_tensors="pt")
|
14 |
generated_tokens = model.generate(**encoded_zh)
|
15 |
-
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
16 |
|
17 |
demo = gr.Interface(fn=fn, inputs="text", outputs="text")
|
18 |
demo.launch()
|
|
|
12 |
tokenizer.tgt_lang = "en"
|
13 |
encoded_zh = tokenizer(text, return_tensors="pt")
|
14 |
generated_tokens = model.generate(**encoded_zh)
|
15 |
+
return tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
16 |
|
17 |
demo = gr.Interface(fn=fn, inputs="text", outputs="text")
|
18 |
demo.launch()
|