From a4132322d94b77498b767f5c6ff159bb95083e98 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 5 Jan 2025 00:28:36 -0800 Subject: [PATCH] refac --- backend/open_webui/env.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index 95549896a..f16f2ea6e 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -53,9 +53,11 @@ if USE_CUDA.lower() == "true": else: DEVICE_TYPE = "cpu" - -if torch.backends.mps.is_available() and torch.backends.mps.is_built(): - DEVICE_TYPE = "mps" +try: + if torch.backends.mps.is_available() and torch.backends.mps.is_built(): + DEVICE_TYPE = "mps" +except Exception: + pass #################################### # LOGGING