corfodemo / app.py
sergiolucero's picture
Update app.py
71cdb69 verified
raw
history blame
841 Bytes
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()