Spaces:
Runtime error
Runtime error
Pablo Ojea Lopez
commited on
Commit
·
d233277
1
Parent(s):
994d17b
Funcionando el traductor de texto V01
Browse files
app.py
CHANGED
@@ -5,7 +5,8 @@ from transformers import pipeline
|
|
5 |
def translate(name):
|
6 |
|
7 |
trans = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es", tokenizer="Helsinki-NLP/opus-mt-en-es")
|
8 |
-
|
|
|
9 |
|
10 |
demo = gr.Interface(fn=translate, inputs="text", outputs="text")
|
11 |
|
|
|
5 |
def translate(name):
|
6 |
|
7 |
trans = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es", tokenizer="Helsinki-NLP/opus-mt-en-es")
|
8 |
+
data_1 = trans(name)[0]["translation_text"]
|
9 |
+
return data_1
|
10 |
|
11 |
demo = gr.Interface(fn=translate, inputs="text", outputs="text")
|
12 |
|