Fix extra template loading (#40455)

* Fix extra template loading

* Reformat

* Trigger tests
This commit is contained in:
Matt
2025-08-26 14:01:01 +01:00
committed by GitHub
parent 58cebc848b
commit 263d06fedc

View File

@ -2015,6 +2015,7 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
revision=revision,
cache_dir=cache_dir,
):
template = template.removesuffix(".jinja")
vocab_files[f"chat_template_{template}"] = f"{CHAT_TEMPLATE_DIR}/{template}.jinja"
# Get files from url, cache, or disk depending on the case