Spaces:
Runtime error
Runtime error
File size: 841 Bytes
534e084 d8215b2 246edcb 52bf87c d8215b2 52bf87c 71cdb69 52bf87c 9e2f17d 52bf87c 534e084 71cdb69 534e084 52bf87c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import gradio as gr
from pydub import AudioSegment
from ailib import whisper_transcribe
def transcribe(audiofile):
#audio = AudioSegment.from_file(audiofile)
#open(filename, 'wb').write(audio)
return whisper_transcribe(audiofile)
# gr.title("Demo CORFO")
audemo = gr.Interface(
transcribe,
gr.Audio(sources=["microphone"], type="filepath"),
"text",
)
with gr.Blocks() as demo:
audemo
with gr.Row():
with gr.Column(scale=1):
radio = gr.Radio(choices=["Option 1", "Option 2"], label="Select an option", value="Option 1", interactive=True)
with gr.Column(scale=3):
with gr.Row():
left_text = gr.Markdown()
right_text = gr.Markdown()
radio.change(display_text, inputs=radio, outputs=[left_text, right_text])
demo.launch()
|