mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-24 14:34:51 -06:00
perf: skip torch import on non-macOS (#23438)
This commit is contained in:
@@ -60,13 +60,14 @@ if USE_CUDA.lower() == 'true':
|
||||
else:
|
||||
DEVICE_TYPE = 'cpu'
|
||||
|
||||
try:
|
||||
import torch
|
||||
if sys.platform == 'darwin':
|
||||
try:
|
||||
import torch
|
||||
|
||||
if torch.backends.mps.is_available() and torch.backends.mps.is_built():
|
||||
DEVICE_TYPE = 'mps'
|
||||
except Exception:
|
||||
pass
|
||||
if torch.backends.mps.is_available() and torch.backends.mps.is_built():
|
||||
DEVICE_TYPE = 'mps'
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
####################################
|
||||
# LOGGING
|
||||
|
||||
Reference in New Issue
Block a user