Spaces:
Runtime error
Runtime error
Pablo Ojea Lopez
commited on
Commit
·
d132638
1
Parent(s):
d0addec
Prueba_08
Browse files
app.py
CHANGED
@@ -1,16 +1,12 @@
|
|
1 |
-
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
-
# sample_text = "Lolo is singing in the rain!!"
|
6 |
-
|
7 |
def translate(name):
|
8 |
|
9 |
trans = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es", tokenizer="Helsinki-NLP/opus-mt-en-es")
|
10 |
return trans(name)[0]["translation_text"]
|
11 |
|
12 |
-
# print (translate(sample_text))
|
13 |
-
|
14 |
demo = gr.Interface(fn=translate, inputs="text", outputs="text")
|
15 |
|
16 |
demo.launch()
|
|
|
1 |
+
import sentencepiece
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
|
|
|
|
5 |
def translate(name):
|
6 |
|
7 |
trans = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es", tokenizer="Helsinki-NLP/opus-mt-en-es")
|
8 |
return trans(name)[0]["translation_text"]
|
9 |
|
|
|
|
|
10 |
demo = gr.Interface(fn=translate, inputs="text", outputs="text")
|
11 |
|
12 |
demo.launch()
|