Spaces:
Runtime error
Runtime error
Commit
·
add3fc6
1
Parent(s):
e8aeaf1
test
Browse files
app.py
CHANGED
@@ -15,15 +15,14 @@ INDIC = {"Assamese": "as", "Bengali": "bn", "Gujarati": "gu", "Hindi": "hi","Kan
|
|
15 |
def translate(text, lang):
|
16 |
return indic2en_model.translate_paragraph(text, INDIC[lang], 'en')
|
17 |
|
18 |
-
|
19 |
languages = list(INDIC.keys())
|
20 |
drop_down = gr.inputs.Dropdown(languages, type="value", default="Hindi", label="Select Source Language")
|
21 |
text = gr.inputs.Textbox(lines=5, placeholder="Enter Text to translate", default="", label="Enter Text in Source Language")
|
22 |
-
text_ouptut = gr.outputs.Textbox(
|
23 |
|
24 |
# example=[['I want to translate this sentence in Hindi','Hindi'],
|
25 |
# ['I am feeling very good today.', 'Bengali']]
|
26 |
|
27 |
supported_lang = ', '.join(languages)
|
28 |
-
iface = gr.Interface(fn=translate, inputs=[text,drop_down] , outputs=text_ouptut, title='IndicTrans NMT System', description = 'Currently the model supports ' + supported_lang
|
29 |
-
iface.launch(
|
|
|
15 |
def translate(text, lang):
|
16 |
return indic2en_model.translate_paragraph(text, INDIC[lang], 'en')
|
17 |
|
|
|
18 |
languages = list(INDIC.keys())
|
19 |
drop_down = gr.inputs.Dropdown(languages, type="value", default="Hindi", label="Select Source Language")
|
20 |
text = gr.inputs.Textbox(lines=5, placeholder="Enter Text to translate", default="", label="Enter Text in Source Language")
|
21 |
+
text_ouptut = gr.outputs.Textbox(label="Translated text in English")
|
22 |
|
23 |
# example=[['I want to translate this sentence in Hindi','Hindi'],
|
24 |
# ['I am feeling very good today.', 'Bengali']]
|
25 |
|
26 |
supported_lang = ', '.join(languages)
|
27 |
+
iface = gr.Interface(enable_queue=True,fn=translate, inputs=[text,drop_down] , outputs=text_ouptut, title='IndicTrans NMT System', description = 'Currently the model supports ' + supported_lang , examples=None)
|
28 |
+
iface.launch(debug=True, inline=True, share=True)
|