Spaces:
Sleeping
Sleeping
paulbauriegel
commited on
Commit
•
67cfc3d
1
Parent(s):
b7292ec
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def speech_to_text(mic=None, file=None, lang=None):
|
|
18 |
print(lang, task)
|
19 |
|
20 |
time_start = time.time()
|
21 |
-
segments, info = model.transcribe(audio, task=task,
|
22 |
print("Detected language '%s' with probability %f" % (info.language, info.language_probability))
|
23 |
|
24 |
# Decode audio to Text
|
@@ -63,7 +63,7 @@ with gr.Blocks(title='Whisper Demo', theme=theme) as demo:
|
|
63 |
''')
|
64 |
audio_in = gr.Audio(label="Record", source='microphone', type="filepath")
|
65 |
file_in = gr.Audio(label="Upload", source='upload', type="filepath")
|
66 |
-
drop_down = gr.Dropdown(["de", "en", "es", "fr", "ru"], value=
|
67 |
transcribe_btn = gr.Button("Transcribe audio", variant="primary")
|
68 |
translate_btn = gr.Button("Translate audio")
|
69 |
trans_df = gr.DataFrame(label="Transcription dataframe", row_count=(0, "dynamic"), max_rows = 10, wrap=True, overflow_row_behaviour='paginate')
|
|
|
18 |
print(lang, task)
|
19 |
|
20 |
time_start = time.time()
|
21 |
+
segments, info = model.transcribe(audio, task=task, language=lang, beam_size=5)
|
22 |
print("Detected language '%s' with probability %f" % (info.language, info.language_probability))
|
23 |
|
24 |
# Decode audio to Text
|
|
|
63 |
''')
|
64 |
audio_in = gr.Audio(label="Record", source='microphone', type="filepath")
|
65 |
file_in = gr.Audio(label="Upload", source='upload', type="filepath")
|
66 |
+
drop_down = gr.Dropdown(["de", "en", "es", "fr", "ru", None], value=None)
|
67 |
transcribe_btn = gr.Button("Transcribe audio", variant="primary")
|
68 |
translate_btn = gr.Button("Translate audio")
|
69 |
trans_df = gr.DataFrame(label="Transcription dataframe", row_count=(0, "dynamic"), max_rows = 10, wrap=True, overflow_row_behaviour='paginate')
|