Spaces:
Sleeping
Sleeping
Edit upload folder path
Browse files- app/utils/file_utils.py +3 -2
app/utils/file_utils.py
CHANGED
|
@@ -15,9 +15,10 @@ from fastapi import UploadFile
|
|
| 15 |
|
| 16 |
|
| 17 |
# Use ./data/uploads for writable folder inside Hugging Face Spaces
|
| 18 |
-
UPLOAD_DIR = "./
|
| 19 |
os.makedirs(UPLOAD_DIR, exist_ok=True)
|
| 20 |
|
|
|
|
| 21 |
def save_upload_file(file: UploadFile) -> str:
|
| 22 |
"""
|
| 23 |
Save an uploaded file to the UPLOAD_DIR
|
|
@@ -29,4 +30,4 @@ def save_upload_file(file: UploadFile) -> str:
|
|
| 29 |
with open(file_path, "wb") as buffer:
|
| 30 |
shutil.copyfileobj(file.file, buffer)
|
| 31 |
|
| 32 |
-
return file_path
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
# Use ./data/uploads for writable folder inside Hugging Face Spaces
|
| 18 |
+
UPLOAD_DIR = "./uploads"
|
| 19 |
os.makedirs(UPLOAD_DIR, exist_ok=True)
|
| 20 |
|
| 21 |
+
|
| 22 |
def save_upload_file(file: UploadFile) -> str:
|
| 23 |
"""
|
| 24 |
Save an uploaded file to the UPLOAD_DIR
|
|
|
|
| 30 |
with open(file_path, "wb") as buffer:
|
| 31 |
shutil.copyfileobj(file.file, buffer)
|
| 32 |
|
| 33 |
+
return file_path
|