@@ -144,6 +144,7 @@ def main() -> None:
144
144
parser .add_argument ("--general-description" , type = str , help = "The models general.description" , metavar = '"Description ..."' )
145
145
parser .add_argument ("--chat-template" , type = str , help = "Chat template string (or JSON string containing templates)" , metavar = '"{% ... %} ..."' )
146
146
parser .add_argument ("--chat-template-config" , type = Path , help = "Config file containing chat template(s)" , metavar = 'tokenizer_config.json' )
147
+ parser .add_argument ("--pre-tokenizer" , type = str , help = "The models tokenizer.ggml.pre" , metavar = '"pre tokenizer"' )
147
148
parser .add_argument ("--remove-metadata" , action = "append" , type = str , help = "Remove metadata (by key name) from output model" , metavar = 'general.url' )
148
149
parser .add_argument ("--special-token" , action = "append" , type = str , help = "Special token by value" , nargs = 2 , metavar = (' | ' .join (token_names .keys ()), '"<token>"' ))
149
150
parser .add_argument ("--special-token-by-id" , action = "append" , type = str , help = "Special token by id" , nargs = 2 , metavar = (' | ' .join (token_names .keys ()), '0' ))
@@ -172,6 +173,9 @@ def main() -> None:
172
173
if template :
173
174
new_metadata [gguf .Keys .Tokenizer .CHAT_TEMPLATE ] = MetadataDetails (gguf .GGUFValueType .STRING , template )
174
175
176
+ if args .pre_tokenizer :
177
+ new_metadata [gguf .Keys .Tokenizer .PRE ] = MetadataDetails (gguf .GGUFValueType .STRING , args .pre_tokenizer )
178
+
175
179
if remove_metadata :
176
180
logger .warning ('*** Warning *** Warning *** Warning **' )
177
181
logger .warning ('* Most metadata is required for a fully functional GGUF file,' )
0 commit comments