소스 검색

fix: torch mps not working

Co-Authored-By: Rich Tong <1782087+richtong@users.noreply.github.com>
Timothy Jaeryang Baek 3 달 전
부모
커밋
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: