Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -97,7 +97,12 @@ def run_my_code(input_text, language):
|
|
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,7 +163,7 @@ output_textbox = gr.outputs.Textbox(label="The Translated Text is:")
|
|
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 |
|
|
|
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 |
+
if(language=="Marathi"):
|
102 |
+
model_checkpoint = "./models/marathi_model.pt"
|
103 |
+
data_root="./MUSTC_ROOT_marathi/en-mt/"
|
104 |
+
d_r="MUSTC_ROOT_marathi/"
|
105 |
+
yam="./MUSTC_ROOT_marathi/en-mt/data/tst-COMMON/txt/tst-COMMON.yaml"
|
106 |
|
107 |
|
108 |
|
|
|
163 |
# Create a Gradio interface
|
164 |
iface = gr.Interface(
|
165 |
fn=run_my_code,
|
166 |
+
inputs=[gr.inputs.Audio(source="microphone", type="filepath", label="Record something (in American/British English Accent)..."), gr.inputs.Radio(["Hindi", "Bengali", "Marathi", "Gujrati", "Tamil", "Nepali", "French", "German"], label="Language To be Translated To")],
|
167 |
outputs=output_textbox,
|
168 |
title="English Speech To Multilingual Text Translator")
|
169 |
|