Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
with gr.Blocks() as demo:
|
4 |
+
buffer = gr.State()
|
5 |
+
with gr.Row():
|
6 |
+
with gr.Column(scale=3):
|
7 |
+
audio = gr.Audio(sources="microphone", type="filepath")
|
8 |
+
|
9 |
+
with gr.Tabs() as tabs:
|
10 |
+
with gr.Tab("Transcripci贸n", id=0):
|
11 |
+
transcription = gr.Textbox(label="Transcription", lines=10, interactive=True, show_label=False)
|
12 |
+
metrics_label = gr.JSON({}, visible=False, label="Metrics")
|
13 |
+
|
14 |
+
with gr.Tab("Nota Cl铆nica", id=1):
|
15 |
+
t = gr.Textbox()
|
16 |
+
|
17 |
+
with gr.Column(scale=1):
|
18 |
+
generate_report_btn = gr.Button("Crear nota", size="sm", variant="primary")
|
19 |
+
clear_btn = gr.ClearButton(
|
20 |
+
[audio, buffer, transcription], value="Resetear la grabaci贸n", size="sm", variant="secondary"
|
21 |
+
)
|
22 |
+
|
23 |
+
with gr.Accordion("Danos feedback!", open=False):
|
24 |
+
correo_input = gr.Textbox(label="Correo", placeholder="Opcionalmente dejanos tu correo.")
|
25 |
+
feedback_input = gr.Textbox(
|
26 |
+
label="Feedback",
|
27 |
+
placeholder="Escribe cualquier feedback que tengas sobre la aplicaci贸n. Qu茅 te gusta, qu茅 cambiar铆as, qu茅 no funciona, etc.",
|
28 |
+
lines=4,
|
29 |
+
)
|
30 |
+
feedback_button = gr.Button("Enviar")
|
31 |
+
|
32 |
+
|
33 |
+
audio.stop_recording(lambda x:x, audio, transcription)
|
34 |
+
clear_btn.click(lambda :"Note", None, t)
|
35 |
+
|
36 |
+
demo.launch()
|