Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import whisper
|
| 2 |
-
|
| 3 |
-
import gradio
|
| 4 |
|
| 5 |
def transcribe(audio):
|
| 6 |
|
|
@@ -22,13 +21,25 @@ def transcribe(audio):
|
|
| 22 |
return result.text
|
| 23 |
|
| 24 |
|
| 25 |
-
gradio.Interface(
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
fn=transcribe,
|
| 28 |
inputs=[
|
| 29 |
-
|
| 30 |
],
|
| 31 |
outputs=[
|
| 32 |
-
"
|
| 33 |
],
|
| 34 |
-
live=True
|
|
|
|
|
|
| 1 |
import whisper
|
| 2 |
+
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
def transcribe(audio):
|
| 5 |
|
|
|
|
| 21 |
return result.text
|
| 22 |
|
| 23 |
|
| 24 |
+
# gradio.Interface(
|
| 25 |
+
# title = 'OpenAI-Whisper Audio to Text Web UI',
|
| 26 |
+
# fn=transcribe,
|
| 27 |
+
# inputs=[
|
| 28 |
+
# gradio.inputs.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)
|