fixed ai server binding

This commit is contained in:
Linrador 2026-05-12 09:49:42 +02:00
parent d02337fd49
commit a59239bd36
2 changed files with 8 additions and 1 deletions

View File

@ -383,6 +383,13 @@ def predict_batch(req: PredictBatchRequest):
"error": _MODEL_ERROR or f"YOLO model not found: {DEFAULT_MODEL_PATH}",
}
if DETECTION_LABELS_PATH is None or _LABEL_ERROR:
return {
"ok": False,
"predictions": [],
"error": f"detection labels missing: {_LABEL_ERROR}",
}
imgsz = int(req.imageSize or _IMGSZ or 640)
try:

View File

@ -314,7 +314,7 @@ func startAIServer(ctx context.Context) (*aiServerProcess, error) {
args = append(args,
"-m", "uvicorn",
"ai_server:app",
"--host", "127.0.0.1",
"--host", "0.0.0.0",
"--port", port,
"--log-level", "error",
)