()
| 1093 | |
| 1094 | |
| 1095 | def parse_args() -> argparse.Namespace: |
| 1096 | parser = argparse.ArgumentParser( |
| 1097 | description="Convert a huggingface model to a GGML compatible file") |
| 1098 | parser.add_argument( |
| 1099 | "--vocab-only", action="store_true", |
| 1100 | help="extract only the vocab", |
| 1101 | ) |
| 1102 | parser.add_argument( |
| 1103 | "--awq-path", type=Path, default=None, |
| 1104 | help="Path to scale awq cache file") |
| 1105 | parser.add_argument( |
| 1106 | "--outfile", type=Path, |
| 1107 | help="path to write to; default: based on input", |
| 1108 | ) |
| 1109 | parser.add_argument( |
| 1110 | "--outtype", type=str, choices=ftype_map.keys(), default="f32", |
| 1111 | help="output format - use f32 for float32, f16 for float16", |
| 1112 | ) |
| 1113 | parser.add_argument("--bigendian", action="store_true", help="model is executed on big endian machine") |
| 1114 | parser.add_argument( |
| 1115 | "model", type=Path, |
| 1116 | help="directory containing model file", |
| 1117 | ) |
| 1118 | parser.add_argument("--use-temp-file", action="store_true", help="use the tempfile library while processing (helpful when running out of memory, process killed)") |
| 1119 | parser.add_argument("--model-name", type=str, default=None, help="name of the model") |
| 1120 | parser.add_argument("--verbose", action="store_true", help="increase output verbosity") |
| 1121 | parser.add_argument("--quant-embd", action="store_true", help="quantize the embedding layer") |
| 1122 | |
| 1123 | return parser.parse_args() |
| 1124 | |
| 1125 | |
| 1126 | def main() -> None: |
no outgoing calls
no test coverage detected