Spaces:
Running
Running
Arius XI
commited on
Commit
·
6f6654e
1
Parent(s):
6ff0af1
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as grad
|
3 |
+
|
4 |
+
mdl_name = "Helsinki-NLP/opus-mt-en-ar"
|
5 |
+
opus_translator = pipeline("translation", model=mdl_name)
|
6 |
+
|
7 |
+
def translate(text):
|
8 |
+
response = opus_translator(text)
|
9 |
+
return response
|
10 |
+
|
11 |
+
grad.Interface(translate, inputs=["text",], outputs="text").launch()
|