浏览代码

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: