(args)
| 4 | |
| 5 | |
| 6 | def 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 | |
| 21 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…