Skip to content

Commit 282e71f

Browse files
edit cmd line args
1 parent 079dfe3 commit 282e71f

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

convert-hf-to-gguf.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,10 +2799,6 @@ def parse_args() -> argparse.Namespace:
27992799
"--verbose", action="store_true",
28002800
help="increase output verbosity",
28012801
)
2802-
parser.add_argument(
2803-
"--split", action="store_true",
2804-
help="split the converted model into multiple files",
2805-
)
28062802
parser.add_argument(
28072803
"--split-max-tensors", type=int,
28082804
help="max tensors in each split",
@@ -2816,8 +2812,8 @@ def parse_args() -> argparse.Namespace:
28162812
help="only print out a split plan and exit, without writing any new files",
28172813
)
28182814
parser.add_argument(
2819-
"--small-first-shard", action="store_true",
2820-
help="do not add tensors to the first shard (disabled by default)",
2815+
"--no-tensor-first-split", action="store_true",
2816+
help="do not add tensors to the first split (disabled by default)"
28212817
)
28222818

28232819
return parser.parse_args()
@@ -2847,9 +2843,6 @@ def main() -> None:
28472843
logger.error(f'Error: {args.model} is not a directory')
28482844
sys.exit(1)
28492845

2850-
if args.split and not (args.split_max_tensors or args.split_max_size):
2851-
raise ValueError("Need to specify one of --split-max-tensors or --split-max-size when splitting")
2852-
28532846
if args.split_max_tensors and args.split_max_size:
28542847
raise ValueError("Can't specify both --split-max-tensors and --split-max-size")
28552848

gguf-py/gguf/gguf_writer_split.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ class SplitStyle(IntEnum):
4848

4949
class SplitArguments:
5050
def __init__(self, args: Namespace) -> None:
51-
self.split = args.split
52-
self.split_max_tensors = args.split_max_tensors if args.split else 0
53-
self.split_max_size = GGUFWriterSplit.split_str_to_n_bytes(args.split_max_size) if args.split and args.split_max_size else 0
54-
self.split_style = SplitStyle.NONE if not self.split \
55-
else SplitStyle.TENSORS if self.split_max_tensors \
56-
else SplitStyle.SIZE
51+
self.split_max_tensors = args.split_max_tensors if args.split_max_tensors else 0
52+
self.split_max_size = GGUFWriterSplit.split_str_to_n_bytes(args.split_max_size) if args.split_max_size else 0
53+
self.split_style = SplitStyle.TENSORS if self.split_max_tensors \
54+
else SplitStyle.SIZE if self.split_max_size \
55+
else SplitStyle.NONE
5756
self.dry_run = args.dry_run
58-
self.small_first_shard = args.small_first_shard
57+
self.small_first_shard = args.no_tensor_first_split
5958

6059

6160
class GGUFWriterSplit(GGUFWriter):

0 commit comments

Comments
 (0)