Update app.py
Browse files
app.py
CHANGED
|
@@ -221,10 +221,14 @@ AYUDAS DIAGNOSTICAS:
|
|
| 221 |
lines=20,
|
| 222 |
)
|
| 223 |
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
debug_output = gr.Textbox(label="Informaci贸n de Depuraci贸n", lines=10)
|
| 229 |
|
| 230 |
def on_process_click(audio_filepath, pdfs, current_text):
|
|
@@ -232,7 +236,13 @@ AYUDAS DIAGNOSTICAS:
|
|
| 232 |
updated_text, debug_info = process_input(audio_filepath, pdfs, current_text)
|
| 233 |
return updated_text, debug_info
|
| 234 |
|
| 235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
fn=on_process_click,
|
| 237 |
inputs=[audio_filepath, pdf_files, iterative_output],
|
| 238 |
outputs=[iterative_output, debug_output]
|
|
|
|
| 221 |
lines=20,
|
| 222 |
)
|
| 223 |
|
| 224 |
+
audio_filepath = gr.Audio(
|
| 225 |
+
sources=["microphone"], type="filepath", label="Entrada de Audio"
|
| 226 |
+
)
|
| 227 |
+
pdf_files = gr.File(
|
| 228 |
+
file_types=[".pdf"],
|
| 229 |
+
label="Subir PDFs (puedes subir m煤ltiples archivos)",
|
| 230 |
+
file_count="multiple"
|
| 231 |
+
)
|
| 232 |
debug_output = gr.Textbox(label="Informaci贸n de Depuraci贸n", lines=10)
|
| 233 |
|
| 234 |
def on_process_click(audio_filepath, pdfs, current_text):
|
|
|
|
| 236 |
updated_text, debug_info = process_input(audio_filepath, pdfs, current_text)
|
| 237 |
return updated_text, debug_info
|
| 238 |
|
| 239 |
+
# Configuramos eventos para procesar autom谩ticamente cuando se detiene la grabaci贸n o se suben PDFs
|
| 240 |
+
audio_filepath.change(
|
| 241 |
+
fn=on_process_click,
|
| 242 |
+
inputs=[audio_filepath, pdf_files, iterative_output],
|
| 243 |
+
outputs=[iterative_output, debug_output]
|
| 244 |
+
)
|
| 245 |
+
pdf_files.change(
|
| 246 |
fn=on_process_click,
|
| 247 |
inputs=[audio_filepath, pdf_files, iterative_output],
|
| 248 |
outputs=[iterative_output, debug_output]
|