Skip to content

Commit 46ea977

Browse files
committed
fix(inference): return $error NO_MODEL_ID vs later crash on None
1 parent 21a0425 commit 46ea977

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

api/app.py

+7
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ def inference(all_inputs: dict) -> dict:
165165

166166
model_id = call_inputs.get("MODEL_ID", None)
167167
if not model_id:
168+
if not MODEL_ID:
169+
return {
170+
"$error": {
171+
"code": "NO_MODEL_ID",
172+
"message": "No callInputs.MODEL_ID specified, nor was MODEL_ID env var set.",
173+
}
174+
}
168175
model_id = MODEL_ID
169176
result["$meta"].update({"MODEL_ID": MODEL_ID})
170177
normalized_model_id = model_id

0 commit comments

Comments
 (0)