Harveenchadha commited on
Commit
86b5efd
·
1 Parent(s): 0ee68a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -16,8 +16,14 @@ indic2en_model = Model(expdir='en-indic')
16
  def translate(text):
17
  return indic2en_model.translate_paragraph(text, 'en', 'hi')
18
 
 
 
 
 
 
19
  print(translate('helo how are you'))
 
20
 
21
 
22
- iface = grd.Interface(fn=translate, inputs="text", outputs="text")
23
  iface.launch()
 
16
  def translate(text):
17
  return indic2en_model.translate_paragraph(text, 'en', 'hi')
18
 
19
+
20
+ INDIC = {"Assamese": "as", "Bengali": "bn", "Gujarati": "gu", "Hindi": "hi","Kannada": "kn","Malayalam": "ml", "Marathi": "mr", "Odia": "or","Punjabi": "pa","Tamil": "ta", "Telugu" : "te"}
21
+
22
+ languages = INDIC.keys()
23
+
24
  print(translate('helo how are you'))
25
+ ddwn = gradio.inputs.Dropdown(languages, type="value", default="Hindi", label="Select Target Language")
26
 
27
 
28
+ iface = grd.Interface(fn=translate, inputs=["text",ddwn] , outputs="text")
29
  iface.launch()