MCPcopy Create free account
hub / github.com/andrewkchan/deepseek.cpp / load_and_dequantize

Function load_and_dequantize

convert.py:319–324  ·  view source on GitHub ↗
(weight_name: str, scale_name: str)

Source from the content-addressed store, hash-verified

317 tensors = {}
318
319 def load_and_dequantize(weight_name: str, scale_name: str) -> torch.Tensor:
320 t = weights[weight_name]
321 if scale_name in weights:
322 scale = weights[scale_name]
323 t = blockwise_dequantize(t, scale, dequant_block_size)
324 return t
325
326 def quantize(t: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:
327 if dtype not in [torch.float32, torch.float16]:

Callers 2

convFunction · 0.85
load_weightsFunction · 0.85

Calls 1

blockwise_dequantizeFunction · 0.85

Tested by

no test coverage detected