MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / main

Function main

examples/low_level_api/quantize.py:6–18  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

4
5
6def main(args):
7 fname_inp = args.fname_inp.encode("utf-8")
8 fname_out = args.fname_out.encode("utf-8")
9 if not os.path.exists(fname_inp):
10 raise RuntimeError(f"Input file does not exist ({fname_inp})")
11 if os.path.exists(fname_out):
12 raise RuntimeError(f"Output file already exists ({fname_out})")
13 ftype = args.type
14 args = llama_cpp.llama_model_quantize_default_params()
15 args.ftype = ftype
16 return_code = llama_cpp.llama_model_quantize(fname_inp, fname_out, args)
17 if return_code != 0:
18 raise RuntimeError("Failed to quantize model")
19
20
21if __name__ == "__main__":

Callers 1

quantize.pyFile · 0.70

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…