File size: 695 Bytes
87dca7d
a2c6feb
c829c5b
4236010
c829c5b
4f8631f
 
 
 
3814228
 
87dca7d
627d9cd
1842d01
87dca7d
a2c6feb
 
87dca7d
d6d572c
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
import gradio as gr

os.system('wget -q https://storage.googleapis.com/vakyaansh-open-models/translation_models/en-indic.zip')
os.system('unzip /home/user/app/en-indic.zip')
os.system('pip uninstall -y numpy')
os.system('pip install numpy==1.19.5')
os.system('pip uninstall -y numba')
os.system('pip install numba==0.53')

from fairseq import checkpoint_utils, distributed_utils, options, tasks, utils

from inference.engine import Model
indic2en_model = Model(expdir='en-indic')

def translate(text):
  return indic2en_model.translate_paragraph(text, 'en', 'hi')

print(translate('helo how are you'))

#iface = gr.Interface(fn=translate, inputs="text", outputs="text")
#iface.launch()