Skip to content

Commit

Permalink
fix(api): use first available platform if requested one does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 5, 2023
1 parent 401df84 commit 15c651b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/onnx_web/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def pipeline_from_request() -> Tuple[DeviceParams, ImageParams, Size]:
device = available_platforms[0]

if device is None:
raise Exception("unknown device")
logger.warn('unknown platform: %s', device_name)
device = available_platforms[0]

# pipeline stuff
model = get_not_empty(request.args, "model", get_config_value("model"))
Expand Down

0 comments on commit 15c651b

Please sign in to comment.