mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Add chat_template for tokenizer extracted from GGUF model (#32908)
* add chat_template to gguf tokenizer * add template through tokenizer config
This commit is contained in:
parent
99d67f1a09
commit
ee8c01f839
@ -121,8 +121,10 @@ class PreTrainedTokenizerFast(PreTrainedTokenizerBase):
|
||||
gguf_param = load_gguf_checkpoint(kwargs.get("vocab_file"))
|
||||
architecture = gguf_param["config"]["model_type"]
|
||||
tokenizer_dict = gguf_param["tokenizer"]
|
||||
tokenizer_config = gguf_param["tokenizer_config"]
|
||||
fast_tokenizer, additional_kwargs = convert_gguf_tokenizer(architecture, tokenizer_dict)
|
||||
|
||||
kwargs.update(tokenizer_config)
|
||||
if len(additional_kwargs) > 0:
|
||||
kwargs.update(additional_kwargs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user