Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -70,11 +70,11 @@ def process_pdf(pdf_file):
|
|
70 |
json.dump(extracted_data, f, ensure_ascii=False, indent=2)
|
71 |
|
72 |
# Generate DOCX report
|
73 |
-
docx_path = os.path.join(temp_dir, "rapport_extraction.docx")
|
74 |
-
generator = RapportGenerator(json_path, docx_path)
|
75 |
-
generator.generate_report()
|
76 |
|
77 |
-
return text_file_path, zip_path, json_path
|
78 |
|
79 |
except Exception as e:
|
80 |
raise gr.Error(f"Error processing PDF: {str(e)}")
|
@@ -105,7 +105,7 @@ demo = gr.Interface(
|
|
105 |
gr.File(label="Texte extrait (TXT)"),
|
106 |
gr.File(label="Images annotées (ZIP)"),
|
107 |
gr.File(label="Données extraites (JSON)"),
|
108 |
-
gr.File(label="Rapport généré (DOCX)") # Nouvelle sortie
|
109 |
],
|
110 |
title="Extraction de texte PDF et création d'un rapport DOCX",
|
111 |
description="""
|
|
|
70 |
json.dump(extracted_data, f, ensure_ascii=False, indent=2)
|
71 |
|
72 |
# Generate DOCX report
|
73 |
+
# docx_path = os.path.join(temp_dir, "rapport_extraction.docx")
|
74 |
+
# generator = RapportGenerator(json_path, docx_path)
|
75 |
+
# generator.generate_report()
|
76 |
|
77 |
+
return text_file_path, zip_path, json_path #, docx_path
|
78 |
|
79 |
except Exception as e:
|
80 |
raise gr.Error(f"Error processing PDF: {str(e)}")
|
|
|
105 |
gr.File(label="Texte extrait (TXT)"),
|
106 |
gr.File(label="Images annotées (ZIP)"),
|
107 |
gr.File(label="Données extraites (JSON)"),
|
108 |
+
# gr.File(label="Rapport généré (DOCX)") # Nouvelle sortie
|
109 |
],
|
110 |
title="Extraction de texte PDF et création d'un rapport DOCX",
|
111 |
description="""
|