Spaces:
Sleeping
Sleeping
Sync from GitHub via hub-sync
Browse files
main.py
CHANGED
|
@@ -8,7 +8,7 @@ import tasks as tasks
|
|
| 8 |
from celery.result import AsyncResult
|
| 9 |
import config as config
|
| 10 |
from schemas import SegmentRequest
|
| 11 |
-
|
| 12 |
|
| 13 |
if not config.DEBUG:
|
| 14 |
if config.UPLOAD_DIR.exists():
|
|
@@ -23,6 +23,8 @@ app.add_middleware(
|
|
| 23 |
allow_headers=["*"],
|
| 24 |
)
|
| 25 |
|
|
|
|
|
|
|
| 26 |
app.mount("/uploads", StaticFiles(directory="uploads"), name="uploads")
|
| 27 |
|
| 28 |
|
|
|
|
| 8 |
from celery.result import AsyncResult
|
| 9 |
import config as config
|
| 10 |
from schemas import SegmentRequest
|
| 11 |
+
import os
|
| 12 |
|
| 13 |
if not config.DEBUG:
|
| 14 |
if config.UPLOAD_DIR.exists():
|
|
|
|
| 23 |
allow_headers=["*"],
|
| 24 |
)
|
| 25 |
|
| 26 |
+
os.makedirs("uploads", exist_ok=True)
|
| 27 |
+
os.makedirs("outputs", exist_ok=True) # Good to add this if you use an outputs folder too!
|
| 28 |
app.mount("/uploads", StaticFiles(directory="uploads"), name="uploads")
|
| 29 |
|
| 30 |
|