Spaces:
Sleeping
Sleeping
Commit
·
b1e34d6
1
Parent(s):
a657b87
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
from transformers import pipeline
|
|
|
4 |
|
5 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
|
6 |
+
|
7 |
+
def predict(text):
|
8 |
+
return pipe(text)[0]["translation_text"]
|
9 |
+
|
10 |
+
demo = gr.Interface(
|
11 |
+
fn=predict,
|
12 |
+
inputs='text',
|
13 |
+
outputs='text',
|
14 |
+
)
|
15 |
+
|
16 |
+
demo.launch()
|