فهرست منبع

fix: torch mps not working

Co-Authored-By: Rich Tong <1782087+richtong@users.noreply.github.com>
Timothy Jaeryang Baek 4 ماه پیش
والد
کامیت
960683eced
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      backend/open_webui/env.py

+ 2 - 0
backend/open_webui/env.py

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