Update app.py
Browse files
app.py
CHANGED
|
@@ -22,12 +22,11 @@ def s2t(audio, model_name):
|
|
| 22 |
yield text
|
| 23 |
|
| 24 |
with gr.Blocks() as demo:
|
| 25 |
-
with gr.
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
choices=[
|
| 31 |
"openai/whisper-large-v3",
|
| 32 |
"openai/whisper-large-v2",
|
| 33 |
"openai/whisper-large",
|
|
@@ -35,13 +34,14 @@ with gr.Blocks() as demo:
|
|
| 35 |
"openai/whisper-small",
|
| 36 |
"openai/whisper-base",
|
| 37 |
"openai/whisper-tiny",
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
-
audio.upload(s2t, inputs=[audio, model_name], outputs=output)
|
| 46 |
|
| 47 |
demo.queue().launch(max_threads=4)
|
|
|
|
| 22 |
yield text
|
| 23 |
|
| 24 |
with gr.Blocks() as demo:
|
| 25 |
+
with gr.Row():
|
| 26 |
+
with gr.Column():
|
| 27 |
+
model_name = gr.Dropdown(
|
| 28 |
+
label="Models:",
|
| 29 |
+
choices=[
|
|
|
|
| 30 |
"openai/whisper-large-v3",
|
| 31 |
"openai/whisper-large-v2",
|
| 32 |
"openai/whisper-large",
|
|
|
|
| 34 |
"openai/whisper-small",
|
| 35 |
"openai/whisper-base",
|
| 36 |
"openai/whisper-tiny",
|
| 37 |
+
],
|
| 38 |
+
value="openai/whisper-large-v3",
|
| 39 |
+
)
|
| 40 |
+
audio = gr.Audio(sources=["microphone","upload"], type="filepath", label="Audio")
|
| 41 |
+
|
| 42 |
+
with gr.Column():
|
| 43 |
+
output = gr.Textbox(label="Transcription results")
|
| 44 |
|
| 45 |
+
audio.change(s2t, inputs=[audio, model_name], outputs=output)
|
|
|
|
| 46 |
|
| 47 |
demo.queue().launch(max_threads=4)
|