Update app.py
Browse files
app.py
CHANGED
|
@@ -418,6 +418,7 @@ def upload_pdf(files):
|
|
| 418 |
"""
|
| 419 |
|
| 420 |
def upload_pdf(files):
|
|
|
|
| 421 |
if not files:
|
| 422 |
logging.warning("No files uploaded.")
|
| 423 |
status_message = " Keine Dateien zum Hochladen"
|
|
@@ -445,7 +446,7 @@ def upload_pdf(files):
|
|
| 445 |
print("file.name.............."+str(file.name))
|
| 446 |
print("upload_path.............."+str(upload_path))
|
| 447 |
# Datei zum Hugging Face Space hochladen
|
| 448 |
-
|
| 449 |
|
| 450 |
except Exception as e:
|
| 451 |
logging.error(f"Error uploading file {file.name}: {e}")
|
|
@@ -463,10 +464,10 @@ def update_vectorstore():
|
|
| 463 |
############################################
|
| 464 |
create_vectorstore()
|
| 465 |
logging.info("Vektorstore successfully renewed.")
|
| 466 |
-
status_message
|
| 467 |
except Exception as e:
|
| 468 |
logging.error(f"Error renewing Vektorstore: {e}")
|
| 469 |
-
status_message
|
| 470 |
|
| 471 |
|
| 472 |
########################################
|
|
|
|
| 418 |
"""
|
| 419 |
|
| 420 |
def upload_pdf(files):
|
| 421 |
+
status_message = ""
|
| 422 |
if not files:
|
| 423 |
logging.warning("No files uploaded.")
|
| 424 |
status_message = " Keine Dateien zum Hochladen"
|
|
|
|
| 446 |
print("file.name.............."+str(file.name))
|
| 447 |
print("upload_path.............."+str(upload_path))
|
| 448 |
# Datei zum Hugging Face Space hochladen
|
| 449 |
+
upload_file_to_huggingface(file.name, upload_path)
|
| 450 |
|
| 451 |
except Exception as e:
|
| 452 |
logging.error(f"Error uploading file {file.name}: {e}")
|
|
|
|
| 464 |
############################################
|
| 465 |
create_vectorstore()
|
| 466 |
logging.info("Vektorstore successfully renewed.")
|
| 467 |
+
status_message += " - Vektorstore wurde erneuert."
|
| 468 |
except Exception as e:
|
| 469 |
logging.error(f"Error renewing Vektorstore: {e}")
|
| 470 |
+
status_message += " - Fehler beim Erneuern des Vektorstores."
|
| 471 |
|
| 472 |
|
| 473 |
########################################
|