Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -208,24 +208,24 @@ async def startup():
|
|
| 208 |
logger.info("π Starting Nexus-Nano API...")
|
| 209 |
|
| 210 |
# FIXED: Correct path with hyphen
|
| 211 |
-
model_path = "
|
| 212 |
|
| 213 |
logger.info(f"π Looking for: {model_path}")
|
| 214 |
|
| 215 |
-
if os.path.exists("
|
| 216 |
-
logger.info("π Files in
|
| 217 |
-
for f in os.listdir("
|
| 218 |
-
full_path = os.path.join("
|
| 219 |
if os.path.isfile(full_path):
|
| 220 |
size = os.path.getsize(full_path) / (1024*1024)
|
| 221 |
logger.info(f" β {f} ({size:.2f} MB)")
|
| 222 |
else:
|
| 223 |
-
logger.error("β
|
| 224 |
-
raise FileNotFoundError("
|
| 225 |
|
| 226 |
if not os.path.exists(model_path):
|
| 227 |
logger.error(f"β Model not found: {model_path}")
|
| 228 |
-
logger.error("π‘ Available:", os.listdir("
|
| 229 |
raise FileNotFoundError(f"Missing: {model_path}")
|
| 230 |
|
| 231 |
try:
|
|
@@ -243,7 +243,7 @@ async def health():
|
|
| 243 |
"model": "nexus-nano",
|
| 244 |
"version": "1.0.0",
|
| 245 |
"model_loaded": engine is not None,
|
| 246 |
-
"model_path": "
|
| 247 |
}
|
| 248 |
|
| 249 |
|
|
|
|
| 208 |
logger.info("π Starting Nexus-Nano API...")
|
| 209 |
|
| 210 |
# FIXED: Correct path with hyphen
|
| 211 |
+
model_path = "app/models/nexus-nano.onnx"
|
| 212 |
|
| 213 |
logger.info(f"π Looking for: {model_path}")
|
| 214 |
|
| 215 |
+
if os.path.exists("app/models"):
|
| 216 |
+
logger.info("π Files in app/models/:")
|
| 217 |
+
for f in os.listdir("app/models"):
|
| 218 |
+
full_path = os.path.join("app/models", f)
|
| 219 |
if os.path.isfile(full_path):
|
| 220 |
size = os.path.getsize(full_path) / (1024*1024)
|
| 221 |
logger.info(f" β {f} ({size:.2f} MB)")
|
| 222 |
else:
|
| 223 |
+
logger.error("β app/models/ not found!")
|
| 224 |
+
raise FileNotFoundError("app/models/ directory missing")
|
| 225 |
|
| 226 |
if not os.path.exists(model_path):
|
| 227 |
logger.error(f"β Model not found: {model_path}")
|
| 228 |
+
logger.error("π‘ Available:", os.listdir("app/models"))
|
| 229 |
raise FileNotFoundError(f"Missing: {model_path}")
|
| 230 |
|
| 231 |
try:
|
|
|
|
| 243 |
"model": "nexus-nano",
|
| 244 |
"version": "1.0.0",
|
| 245 |
"model_loaded": engine is not None,
|
| 246 |
+
"model_path": "app/models/nexus-nano.onnx"
|
| 247 |
}
|
| 248 |
|
| 249 |
|