Spaces:
Sleeping
Sleeping
Javitron4257
commited on
Commit
•
9e4d87f
1
Parent(s):
0761899
This is the main file of the space
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
|
5 |
+
def traductor(prompt):
|
6 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
|
7 |
+
frase_traducida=pipe(prompt)
|
8 |
+
return frase_traducida[0]['translation_text']
|
9 |
+
|
10 |
+
demo = gr.Interface(fn=traductor, inputs="text", outputs="text")
|
11 |
+
demo.launch()
|