MCPcopy Create free account
hub / github.com/dhakalnirajan/LLaMA-BitNet / get_device

Function get_device

inference.py:46–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44# ──────────────────────────────────────────────────────────────────────────────
45
46def get_device() -> torch.device:
47 if torch.cuda.is_available():
48 return torch.device("cuda")
49 if torch.backends.mps.is_available():
50 return torch.device("mps")
51 return torch.device("cpu")
52
53
54def _model_has_bitlinear(model: LlamaForCausalLM) -> bool:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected