1
0
Эх сурвалжийг харах

fix: torch mps not working

Co-Authored-By: Rich Tong <1782087+richtong@users.noreply.github.com>
Timothy Jaeryang Baek 4 сар өмнө
parent
commit
960683eced

+ 2 - 0
backend/open_webui/env.py

@@ -54,6 +54,8 @@ else:
     DEVICE_TYPE = "cpu"
     DEVICE_TYPE = "cpu"
 
 
 try:
 try:
+    import torch
+
     if torch.backends.mps.is_available() and torch.backends.mps.is_built():
     if torch.backends.mps.is_available() and torch.backends.mps.is_built():
         DEVICE_TYPE = "mps"
         DEVICE_TYPE = "mps"
 except Exception:
 except Exception: