balaramas commited on
Commit
ab7482c
1 Parent(s): 5b450a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -82,7 +82,12 @@ def run_my_code(input_text, language):
82
  model_checkpoint = "./models/bengali_model.pt"
83
  data_root="./MUSTC_ROOT_bengali/en-bn/"
84
  d_r="MUSTC_ROOT_bengali/"
85
- yam="./MUSTC_ROOT_bengali/en-bn/data/tst-COMMON/txt/tst-COMMON.yaml"
 
 
 
 
 
86
 
87
 
88
 
@@ -143,7 +148,7 @@ output_textbox = gr.outputs.Textbox(label="The Translated Text is:")
143
  # Create a Gradio interface
144
  iface = gr.Interface(
145
  fn=run_my_code,
146
- inputs=[gr.inputs.Audio(source="microphone", type="filepath", label="Record something (in American/British English Accent)..."), gr.inputs.Radio(["Hindi", "Bengali", "French", "German"], label="Language")],
147
  outputs=output_textbox,
148
  title="English Speech to Text Translator")
149
 
 
82
  model_checkpoint = "./models/bengali_model.pt"
83
  data_root="./MUSTC_ROOT_bengali/en-bn/"
84
  d_r="MUSTC_ROOT_bengali/"
85
+ yam="./MUSTC_ROOT_bengali/en-bn/data/tst-COMMON/txt/tst-COMMON.yaml"
86
+ if(language=="Nepali"):
87
+ model_checkpoint = "./models/nepali_model.pt"
88
+ data_root="./MUSTC_ROOT_nepali/en-ne/"
89
+ d_r="MUSTC_ROOT_nepali/"
90
+ yam="./MUSTC_ROOT_nepali/en-ne/data/tst-COMMON/txt/tst-COMMON.yaml"
91
 
92
 
93
 
 
148
  # Create a Gradio interface
149
  iface = gr.Interface(
150
  fn=run_my_code,
151
+ inputs=[gr.inputs.Audio(source="microphone", type="filepath", label="Record something (in American/British English Accent)..."), gr.inputs.Radio(["Hindi", "Bengali", "Nepali", "French", "German"], label="Language")],
152
  outputs=output_textbox,
153
  title="English Speech to Text Translator")
154