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') 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') iface = gr.Interface(fn=translate, inputs="text", outputs="text") iface.launch()