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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- feat: add Jinja2 loop controls to chat templates by @handshape in #2018
- fix: avoid cleanup errors for partially initialized `LlamaModel` objects by @usernames122 in #2173
- fix: suppress stdout and stderr in Jupyter notebooks by @Anai-Guo in #2181
- feat: enable arm64 musl builds by @acon96 in #2221
Expand Down
7 changes: 6 additions & 1 deletion llama_cpp/llama_chat_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ def __init__(
loader=jinja2.BaseLoader(),
trim_blocks=True,
lstrip_blocks=True,
extensions=[Jinja2ChatFormatter.IgnoreGenerationTags],
# Keep this aligned with Transformers' chat-template Jinja extensions.
# https://github.com/huggingface/transformers/blob/39603d0e5cdb6f00e8d473d7fcbb01032d709181/src/transformers/utils/chat_template_utils.py#L489-L490
extensions=[
Jinja2ChatFormatter.IgnoreGenerationTags,
jinja2.ext.loopcontrols,
],
).from_string(self.template)

@staticmethod
Expand Down
Loading