Spaces:
Sleeping
Sleeping
Indrajit Ari commited on
Commit ·
4e88441
1
Parent(s): 87a48cb
fix: explicit sys.path update to resolve inference module import error at runtime
Browse files- backend/app_hf.py +4 -7
backend/app_hf.py
CHANGED
|
@@ -12,14 +12,11 @@ import os
|
|
| 12 |
import uuid
|
| 13 |
import asyncio
|
| 14 |
import logging
|
|
|
|
|
|
|
| 15 |
from pathlib import Path
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
from fastapi import FastAPI, UploadFile, File, HTTPException, WebSocket, WebSocketDisconnect
|
| 20 |
-
from fastapi.middleware.cors import CORSMiddleware
|
| 21 |
-
from fastapi.responses import FileResponse
|
| 22 |
-
from fastapi.staticfiles import StaticFiles
|
| 23 |
|
| 24 |
from inference import process_video, get_model, VOC_CLASSES
|
| 25 |
|
|
|
|
| 12 |
import uuid
|
| 13 |
import asyncio
|
| 14 |
import logging
|
| 15 |
+
import sys
|
| 16 |
+
import os
|
| 17 |
from pathlib import Path
|
| 18 |
+
# Add current directory to path so relative imports work without package structure
|
| 19 |
+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
from inference import process_video, get_model, VOC_CLASSES
|
| 22 |
|