Spaces:
Runtime error
Runtime error
Harveenchadha
commited on
Commit
·
a2c6feb
1
Parent(s):
ef79ebc
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
|
3 |
os.system('wget -q https://storage.googleapis.com/vakyaansh-open-models/translation_models/en-indic.zip')
|
4 |
os.system('unzip /home/user/app/en-indic.zip')
|
@@ -10,6 +11,8 @@ from fairseq import checkpoint_utils, distributed_utils, options, tasks, utils
|
|
10 |
from inference.engine import Model
|
11 |
indic2en_model = Model(expdir='en-indic')
|
12 |
|
13 |
-
|
|
|
14 |
|
15 |
-
|
|
|
|
1 |
import os
|
2 |
+
import gradio as gr
|
3 |
|
4 |
os.system('wget -q https://storage.googleapis.com/vakyaansh-open-models/translation_models/en-indic.zip')
|
5 |
os.system('unzip /home/user/app/en-indic.zip')
|
|
|
11 |
from inference.engine import Model
|
12 |
indic2en_model = Model(expdir='en-indic')
|
13 |
|
14 |
+
def translate(text):
|
15 |
+
return indic2en_model.translate_paragraph(text, 'en', 'hi')
|
16 |
|
17 |
+
iface = gr.Interface(fn=translate, inputs="text", outputs="text")
|
18 |
+
iface.launch()
|