From a8e27918b9565a3f21344c74342f66f9f0add670 Mon Sep 17 00:00:00 2001 From: Douglas Livingstone Date: Tue, 21 Mar 2023 15:54:15 +0000 Subject: [PATCH] Make vocab_only argument optional Positional arguments must be explicitly optional to use default values, otherwise the examples in the readme fail to run. --- convert-pth-to-ggml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert-pth-to-ggml.py b/convert-pth-to-ggml.py index 46f7eba1c..8b51917c1 100644 --- a/convert-pth-to-ggml.py +++ b/convert-pth-to-ggml.py @@ -29,7 +29,7 @@ def parse_args(): parser = argparse.ArgumentParser(description='Convert a LLaMA model checkpoint to a ggml compatible file') parser.add_argument('dir_model', help='directory containing the model checkpoint') parser.add_argument('ftype', type=int, choices=[0, 1], default=1, help='file type (0: float32, 1: float16)') - parser.add_argument('vocab_only', type=bool, default=False, help='only write vocab to file') + parser.add_argument('vocab_only', type=bool, nargs='?', default=False, help='only write vocab to file') return parser.parse_args() def get_n_parts(dim):