with gradio + requirements.txt
Browse files- app.py +6 -6
- requirements.txt +2 -0
app.py
CHANGED
|
@@ -8,14 +8,14 @@ import gradio as gr
|
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
|
| 19 |
-
demo = gr.load("Helsinki-NLP/opus-mt-en-es", src="models")
|
| 20 |
|
| 21 |
-
demo.launch()
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
+
from transformers import pipeline
|
| 12 |
|
| 13 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
|
| 14 |
|
| 15 |
+
demo = gr.Interface.from_pipeline(pipe)
|
| 16 |
+
demo.launch()
|
| 17 |
|
| 18 |
|
| 19 |
+
#demo = gr.load("Helsinki-NLP/opus-mt-en-es", src="models")
|
| 20 |
|
| 21 |
+
#demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
transformers
|
| 2 |
+
torch
|