Spaces:
Sleeping
Sleeping
Commit ·
9dfc7e6
1
Parent(s): 8a5b45e
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def translate(text):
|
| 4 |
return pipe(text)[0]["translation_text"]
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
|
| 5 |
|
| 6 |
def translate(text):
|
| 7 |
return pipe(text)[0]["translation_text"]
|