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