Spaces:
Runtime error
Runtime error
File size: 1,494 Bytes
33af519 |
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
with gr.Blocks() as demo:
buffer = gr.State()
with gr.Row():
with gr.Column(scale=3):
audio = gr.Audio(sources="microphone", type="filepath")
with gr.Tabs() as tabs:
with gr.Tab("Transcripci贸n", id=0):
transcription = gr.Textbox(label="Transcription", lines=10, interactive=True, show_label=False)
metrics_label = gr.JSON({}, visible=False, label="Metrics")
with gr.Tab("Nota Cl铆nica", id=1):
t = gr.Textbox()
with gr.Column(scale=1):
generate_report_btn = gr.Button("Crear nota", size="sm", variant="primary")
clear_btn = gr.ClearButton(
[audio, buffer, transcription], value="Resetear la grabaci贸n", size="sm", variant="secondary"
)
with gr.Accordion("Danos feedback!", open=False):
correo_input = gr.Textbox(label="Correo", placeholder="Opcionalmente dejanos tu correo.")
feedback_input = gr.Textbox(
label="Feedback",
placeholder="Escribe cualquier feedback que tengas sobre la aplicaci贸n. Qu茅 te gusta, qu茅 cambiar铆as, qu茅 no funciona, etc.",
lines=4,
)
feedback_button = gr.Button("Enviar")
audio.stop_recording(lambda x:x, audio, transcription)
clear_btn.click(lambda :"Note", None, t)
demo.launch() |