Update app.py
Browse files
app.py
CHANGED
|
@@ -20,26 +20,21 @@ def transcribe(audio):
|
|
| 20 |
result = whisper.decode(model, mel, options)
|
| 21 |
return result.text
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
gr.Interface(
|
| 25 |
title = 'OpenAI-Whisper Audio to Text Web UI',
|
| 26 |
fn=transcribe,
|
| 27 |
-
inputs=
|
| 28 |
-
gr.Audio(source="microphone", type="filepath")
|
| 29 |
-
],
|
| 30 |
outputs=[
|
| 31 |
"textbox"
|
| 32 |
],
|
| 33 |
live=True).launch(inline = False)
|
| 34 |
-
|
| 35 |
-
# gr.Interface(
|
| 36 |
-
# title='OpenAI-Whisper Audio to Text Web UI',
|
| 37 |
-
# fn=transcribe,
|
| 38 |
-
# inputs=[
|
| 39 |
-
# gr.inputs.Audio(source="microphone", type="file", label="Record Audio")
|
| 40 |
-
# ],
|
| 41 |
-
# outputs=[
|
| 42 |
-
# gr.outputs.Textbox(label="Transcription")
|
| 43 |
-
# ],
|
| 44 |
-
# live=True
|
| 45 |
-
# ).launch(inline=False)
|
|
|
|
| 20 |
result = whisper.decode(model, mel, options)
|
| 21 |
return result.text
|
| 22 |
|
| 23 |
+
input_audio = gr.Audio(
|
| 24 |
+
sources=["microphone"],
|
| 25 |
+
waveform_options=gr.WaveformOptions(
|
| 26 |
+
waveform_color="#01C6FF",
|
| 27 |
+
waveform_progress_color="#0066B4",
|
| 28 |
+
skip_length=2,
|
| 29 |
+
show_controls=False,
|
| 30 |
+
),
|
| 31 |
+
)
|
| 32 |
|
| 33 |
gr.Interface(
|
| 34 |
title = 'OpenAI-Whisper Audio to Text Web UI',
|
| 35 |
fn=transcribe,
|
| 36 |
+
inputs = input_audio,
|
|
|
|
|
|
|
| 37 |
outputs=[
|
| 38 |
"textbox"
|
| 39 |
],
|
| 40 |
live=True).launch(inline = False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|