Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/transformers/processing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,7 @@ def get_processor_dict(
local_files_only=local_files_only,
revision=revision,
cache_dir=cache_dir,
token=token,
):
additional_chat_template_files[template] = f"{CHAT_TEMPLATE_DIR}/{template}.jinja"
except EntryNotFoundError:
Expand Down
1 change: 1 addition & 0 deletions src/transformers/tokenization_utils_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,7 @@ def from_pretrained(
local_files_only=local_files_only,
revision=revision,
cache_dir=cache_dir,
token=token,
):
template = template.removesuffix(".jinja")
vocab_files[f"chat_template_{template}"] = f"{CHAT_TEMPLATE_DIR}/{template}.jinja"
Expand Down
2 changes: 2 additions & 0 deletions src/transformers/utils/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def list_repo_templates(
local_files_only: bool,
revision: Optional[str] = None,
cache_dir: Optional[str] = None,
token: Union[bool, str, None] = None,
) -> list[str]:
"""List template files from a repo.

Expand All @@ -171,6 +172,7 @@ def list_repo_templates(
revision=revision,
path_in_repo=CHAT_TEMPLATE_DIR,
recursive=False,
token=token,
)
if entry.path.endswith(".jinja")
]
Expand Down