Spaces:
Runtime error
Runtime error
| 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() |