Spaces:
Runtime error
Runtime error
1101411
commited on
Commit
·
a203b52
1
Parent(s):
3ea0b85
test
Browse files
app.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as grad
|
3 |
|
4 |
+
model_name = "facebook/nllb-200-3.3B"
|
5 |
+
opus_translator = pipeline("translation", model=model_name)
|
6 |
|
7 |
+
def translate(text):
|
8 |
+
response = opus_translator(text)
|
9 |
+
return response
|
10 |
+
|
11 |
+
grad.Interface(translate, inputs=["text"], outputs=["text"]).launch()
|