Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -87,7 +87,12 @@ def run_my_code(input_text, language):
|
|
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,7 +153,7 @@ output_textbox = gr.outputs.Textbox(label="The Translated Text is:")
|
|
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 To be Translated To")],
|
152 |
outputs=output_textbox,
|
153 |
title="English Speech To Multilingual Text Translator")
|
154 |
|
|
|
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 |
+
if(language=="Gujrati"):
|
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 |
# 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 |
|