From b7b5a0c4c20bb56224899d56eab917151b741757 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 19 Aug 2025 07:51:11 -0600 Subject: [PATCH] Fix device ID --- frigate/util/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/util/model.py b/frigate/util/model.py index 65f9b6032..9d042d13f 100644 --- a/frigate/util/model.py +++ b/frigate/util/model.py @@ -284,7 +284,7 @@ def post_process_yolox( def get_ort_providers( - force_cpu: bool = False, device: str = "AUTO", requires_fp16: bool = False + force_cpu: bool = False, device: str | None = "AUTO", requires_fp16: bool = False ) -> tuple[list[str], list[dict[str, Any]]]: if force_cpu: return ( @@ -301,7 +301,7 @@ def get_ort_providers( for provider in ort.get_available_providers(): if provider == "CUDAExecutionProvider": - device_id = 0 if not device.isdigit() else int(device) + device_id = 0 if (not device or not device.isdigit()) else int(device) providers.append(provider) options.append( {