Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/mudler/LocalAI
/ _select_device
Function
_select_device
backend/python/liquid-audio/backend.py:77–83 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
75
76
77
def
_select_device():
78
import
torch
79
if
torch.cuda.is_available():
80
return
"cuda"
81
if
hasattr(torch.backends,
"mps"
) and torch.backends.mps.is_available():
82
return
"mps"
83
return
"cpu"
84
85
86
class
ActiveJob:
Callers
1
LoadModel
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected