MCPcopy Index your code
hub / github.com/microsoft/BitNet / parse_args

Function parse_args

utils/generate-dummy-bitnet-model.py:1019–1044  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1017 print(tensor_info_format.format(tensor.name, shape_str, size_str, quantization_str)) # noqa: NP100
1018
1019def parse_args() -> argparse.Namespace:
1020 parser = argparse.ArgumentParser(
1021 description="Generate a dummy bitnet model with GGUF format")
1022 parser.add_argument(
1023 "--vocab-only", action="store_true",
1024 help="extract only the vocab",
1025 )
1026 parser.add_argument(
1027 "--outfile", type=Path,
1028 help="path to write to; default: based on input",
1029 )
1030 parser.add_argument(
1031 "--outtype", type=str, choices=ftype_map.keys(), default="f16",
1032 help="output format - use f32 for float32, f16 for float16",
1033 )
1034 parser.add_argument("--bigendian", action="store_true", help="model is executed on big endian machine")
1035 parser.add_argument(
1036 "model", type=Path,
1037 help="directory containing model file",
1038 )
1039 parser.add_argument("--use-temp-file", action="store_true", help="use the tempfile library while processing (helpful when running out of memory, process killed)")
1040 parser.add_argument("--model-name", type=str, default=None, help="name of the model")
1041 parser.add_argument("--model-size", type=str, default="7B", help="size of the model")
1042 parser.add_argument("--verbose", action="store_true", help="increase output verbosity")
1043
1044 return parser.parse_args()
1045
1046if __name__ == '__main__':
1047 args = parse_args()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected