From d477f73c7efd590e55b78ee248f0bc8b8ef7d8cf Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 5 Jan 2025 00:27:44 -0800 Subject: [PATCH] enh: torch mps support --- backend/open_webui/env.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index 9bdfb0012..95549896a 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -54,6 +54,9 @@ else: DEVICE_TYPE = "cpu" +if torch.backends.mps.is_available() and torch.backends.mps.is_built(): + DEVICE_TYPE = "mps" + #################################### # LOGGING ####################################