balaramas commited on
Commit
d3e410d
·
1 Parent(s): 12e31f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -92,7 +92,12 @@ def run_my_code(input_text, language):
92
  model_checkpoint = "./models/gujrati_model.pt"
93
  data_root="./MUSTC_ROOT_gujrati/en-gj/"
94
  d_r="MUSTC_ROOT_gujrati/"
95
- yam="./MUSTC_ROOT_gujrati/en-gj/data/tst-COMMON/txt/tst-COMMON.yaml"
 
 
 
 
 
96
 
97
 
98
 
@@ -153,7 +158,7 @@ output_textbox = gr.outputs.Textbox(label="The Translated Text is:")
153
  # Create a Gradio interface
154
  iface = gr.Interface(
155
  fn=run_my_code,
156
- inputs=[gr.inputs.Audio(source="microphone", type="filepath", label="Record something (in American/British English Accent)..."), gr.inputs.Radio(["Hindi", "Bengali", "Gujrati", "Nepali", "French", "German"], label="Language To be Translated To")],
157
  outputs=output_textbox,
158
  title="English Speech To Multilingual Text Translator")
159
 
 
92
  model_checkpoint = "./models/gujrati_model.pt"
93
  data_root="./MUSTC_ROOT_gujrati/en-gj/"
94
  d_r="MUSTC_ROOT_gujrati/"
95
+ yam="./MUSTC_ROOT_gujrati/en-gj/data/tst-COMMON/txt/tst-COMMON.yaml"
96
+ if(language=="Tamil"):
97
+ model_checkpoint = "./models/tamil_model.pt"
98
+ data_root="./MUSTC_ROOT_tamil/en-tm/"
99
+ d_r="MUSTC_ROOT_tamil/"
100
+ yam="./MUSTC_ROOT_tamil/en-tm/data/tst-COMMON/txt/tst-COMMON.yaml"
101
 
102
 
103
 
 
158
  # Create a Gradio interface
159
  iface = gr.Interface(
160
  fn=run_my_code,
161
+ inputs=[gr.inputs.Audio(source="microphone", type="filepath", label="Record something (in American/British English Accent)..."), gr.inputs.Radio(["Hindi", "Bengali", "Gujrati", "Tamil", "Nepali", "French", "German"], label="Language To be Translated To")],
162
  outputs=output_textbox,
163
  title="English Speech To Multilingual Text Translator")
164