MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / maybe_do_quantize

Method maybe_do_quantize

convert.py:942–946  ·  view source on GitHub ↗
(item: tuple[DataType, NDArray])

Source from the content-addressed store, hash-verified

940
941 @staticmethod
942 def maybe_do_quantize(item: tuple[DataType, NDArray]) -> NDArray:
943 dt, arr = item
944 if not isinstance(dt, QuantizedDataType):
945 return arr
946 return dt.quantize(arr)
947
948 @staticmethod
949 def write_all(fname_out: Path, ftype: GGMLFileType, params: Params, model: LazyModel, vocab: Vocab, svocab: gguf.SpecialVocab, concurrency: int = DEFAULT_CONCURRENCY, endianess: gguf.GGUFEndian = gguf.GGUFEndian.LITTLE) -> None:

Callers

nothing calls this directly

Calls 1

quantizeMethod · 0.45

Tested by

no test coverage detected