Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -128,7 +128,7 @@ def process(input_mode, target_lang, text_input, audio_input, file_input):
|
|
| 128 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp:
|
| 129 |
tmp.write(audio_input.read())
|
| 130 |
tmp_path = tmp.name
|
| 131 |
-
input_text = transcribe_audio(
|
| 132 |
os.remove(tmp_path)
|
| 133 |
elif input_mode == "File" and file_input:
|
| 134 |
input_text = extract_text_from_file(file_input)
|
|
@@ -149,7 +149,7 @@ with gr.Blocks() as demo:
|
|
| 149 |
|
| 150 |
with gr.Row():
|
| 151 |
text_input = gr.Textbox(label="Enter English text", lines=10)
|
| 152 |
-
audio_input = gr.Audio(type="
|
| 153 |
file_input = gr.File(label="Upload Document")
|
| 154 |
|
| 155 |
with gr.Row():
|
|
|
|
| 128 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp:
|
| 129 |
tmp.write(audio_input.read())
|
| 130 |
tmp_path = tmp.name
|
| 131 |
+
input_text = transcribe_audio(audio_input)
|
| 132 |
os.remove(tmp_path)
|
| 133 |
elif input_mode == "File" and file_input:
|
| 134 |
input_text = extract_text_from_file(file_input)
|
|
|
|
| 149 |
|
| 150 |
with gr.Row():
|
| 151 |
text_input = gr.Textbox(label="Enter English text", lines=10)
|
| 152 |
+
audio_input = gr.Audio(type="filepath", label="Upload Audio")
|
| 153 |
file_input = gr.File(label="Upload Document")
|
| 154 |
|
| 155 |
with gr.Row():
|