Update app.py
Browse files
app.py
CHANGED
|
@@ -381,6 +381,11 @@ def upload_pdf(files):
|
|
| 381 |
upload_path = f"chroma/kkg/word/{filename}"
|
| 382 |
else:
|
| 383 |
upload_path = f"chroma/kkg/{filename}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
|
| 385 |
# Hochladen der Datei
|
| 386 |
future = pool.submit(upload_file_to_huggingface, file.name, upload_path)
|
|
|
|
| 381 |
upload_path = f"chroma/kkg/word/{filename}"
|
| 382 |
else:
|
| 383 |
upload_path = f"chroma/kkg/{filename}"
|
| 384 |
+
|
| 385 |
+
# Entfernen der vorhandenen Datei, falls sie existiert
|
| 386 |
+
if os.path.exists(upload_path):
|
| 387 |
+
os.remove(upload_path)
|
| 388 |
+
logging.info(f"Existing file {upload_path} removed.")
|
| 389 |
|
| 390 |
# Hochladen der Datei
|
| 391 |
future = pool.submit(upload_file_to_huggingface, file.name, upload_path)
|