Rafs-an09002 commited on
Commit
896b495
Β·
verified Β·
1 Parent(s): 7e333ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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 = "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,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": "app/models/nexus-nano.onnx"
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