Skip to content

Commit

Permalink
Add chat_template for tokenizer extracted from GGUF model (#32908)
Browse files Browse the repository at this point in the history
* add chat_template to gguf tokenizer

* add template through tokenizer config
  • Loading branch information
Isotr0py authored Aug 22, 2024
1 parent 99d67f1 commit ee8c01f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transformers/tokenization_utils_fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ def __init__(self, *args, **kwargs):
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)

Expand Down

0 comments on commit ee8c01f

Please sign in to comment.