Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,10 @@ def process_file(file):
|
|
| 12 |
if file is not None:
|
| 13 |
pdf_processor = PDFProcessor()
|
| 14 |
input_text = pdf_processor.pdf_to_text(file.name)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
return input_text
|
| 16 |
return "Por favor, cargue un archivo v谩lido."
|
| 17 |
|
|
@@ -176,4 +180,7 @@ with gr.Blocks() as interface:
|
|
| 176 |
)
|
| 177 |
|
| 178 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
| 179 |
interface.launch()
|
|
|
|
| 12 |
if file is not None:
|
| 13 |
pdf_processor = PDFProcessor()
|
| 14 |
input_text = pdf_processor.pdf_to_text(file.name)
|
| 15 |
+
|
| 16 |
+
# Limpieza de archivos temporales despu茅s de procesar
|
| 17 |
+
PDFProcessor.clear_temp_directory()
|
| 18 |
+
|
| 19 |
return input_text
|
| 20 |
return "Por favor, cargue un archivo v谩lido."
|
| 21 |
|
|
|
|
| 180 |
)
|
| 181 |
|
| 182 |
if __name__ == "__main__":
|
| 183 |
+
# Limpiar archivos temporales antes de lanzar la aplicaci贸n
|
| 184 |
+
PDFProcessor.clear_temp_directory()
|
| 185 |
+
|
| 186 |
interface.launch()
|