diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index 28ecaea7a..fe0066442 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -2799,10 +2799,6 @@ def parse_args() -> argparse.Namespace: "--verbose", action="store_true", help="increase output verbosity", ) - parser.add_argument( - "--split", action="store_true", - help="split the converted model into multiple files", - ) parser.add_argument( "--split-max-tensors", type=int, help="max tensors in each split", @@ -2816,8 +2812,8 @@ def parse_args() -> argparse.Namespace: help="only print out a split plan and exit, without writing any new files", ) parser.add_argument( - "--small-first-shard", action="store_true", - help="do not add tensors to the first shard (disabled by default)", + "--no-tensor-first-split", action="store_true", + help="do not add tensors to the first split (disabled by default)" ) return parser.parse_args() @@ -2847,9 +2843,6 @@ def main() -> None: logger.error(f'Error: {args.model} is not a directory') sys.exit(1) - if args.split and not (args.split_max_tensors or args.split_max_size): - raise ValueError("Need to specify one of --split-max-tensors or --split-max-size when splitting") - if args.split_max_tensors and args.split_max_size: raise ValueError("Can't specify both --split-max-tensors and --split-max-size") diff --git a/gguf-py/gguf/gguf_writer_split.py b/gguf-py/gguf/gguf_writer_split.py index 655cddbfe..b4836737a 100644 --- a/gguf-py/gguf/gguf_writer_split.py +++ b/gguf-py/gguf/gguf_writer_split.py @@ -48,14 +48,13 @@ class SplitStyle(IntEnum): class SplitArguments: def __init__(self, args: Namespace) -> None: - self.split = args.split - self.split_max_tensors = args.split_max_tensors if args.split else 0 - self.split_max_size = GGUFWriterSplit.split_str_to_n_bytes(args.split_max_size) if args.split and args.split_max_size else 0 - self.split_style = SplitStyle.NONE if not self.split \ - else SplitStyle.TENSORS if self.split_max_tensors \ - else SplitStyle.SIZE + self.split_max_tensors = args.split_max_tensors if args.split_max_tensors else 0 + self.split_max_size = GGUFWriterSplit.split_str_to_n_bytes(args.split_max_size) if args.split_max_size else 0 + self.split_style = SplitStyle.TENSORS if self.split_max_tensors \ + else SplitStyle.SIZE if self.split_max_size \ + else SplitStyle.NONE self.dry_run = args.dry_run - self.small_first_shard = args.small_first_shard + self.small_first_shard = args.no_tensor_first_split class GGUFWriterSplit(GGUFWriter):