Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,11 +37,11 @@ def process_file(files, topic):
|
|
| 37 |
'Error processing file: Unsupported file format. Only .docx, .txt, and .pdf are allowed.'
|
| 38 |
|
| 39 |
"""
|
| 40 |
-
progress = gr.Progress()
|
| 41 |
|
| 42 |
log_history = [] # To store logs for each file
|
| 43 |
for i, file in enumerate(files):
|
| 44 |
-
progress(i / len(files), desc=f"Processing file {i + 1}/{len(files)}: {file_path}")
|
| 45 |
|
| 46 |
try:
|
| 47 |
# Read the file content
|
|
@@ -57,7 +57,7 @@ def process_file(files, topic):
|
|
| 57 |
log_history.append( f"Error processing for file {file_path}: {str(e)}")
|
| 58 |
|
| 59 |
|
| 60 |
-
progress(1.0, desc="Processing complete!")
|
| 61 |
return "\n".join(log_history)
|
| 62 |
|
| 63 |
# Define Gradio interface
|
|
|
|
| 37 |
'Error processing file: Unsupported file format. Only .docx, .txt, and .pdf are allowed.'
|
| 38 |
|
| 39 |
"""
|
| 40 |
+
# progress = gr.Progress()
|
| 41 |
|
| 42 |
log_history = [] # To store logs for each file
|
| 43 |
for i, file in enumerate(files):
|
| 44 |
+
# progress(i / len(files), desc=f"Processing file {i + 1}/{len(files)}: {file_path}")
|
| 45 |
|
| 46 |
try:
|
| 47 |
# Read the file content
|
|
|
|
| 57 |
log_history.append( f"Error processing for file {file_path}: {str(e)}")
|
| 58 |
|
| 59 |
|
| 60 |
+
# progress(1.0, desc="Processing complete!")
|
| 61 |
return "\n".join(log_history)
|
| 62 |
|
| 63 |
# Define Gradio interface
|