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

Function _model_has_bitlinear

inference.py:54–56  ·  view source on GitHub ↗

Return True if at least one module in the model is already a BitLinear.

(model: LlamaForCausalLM)

Source from the content-addressed store, hash-verified

52
53
54def _model_has_bitlinear(model: LlamaForCausalLM) -> bool:
55 """Return True if at least one module in the model is already a BitLinear."""
56 return any(isinstance(m, BitLinear) for m in model.modules())
57
58
59def load_model(model_path: str, device: torch.device) -> tuple[LlamaForCausalLM, AutoTokenizer]:

Callers 1

load_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected