File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ - feat: add Jinja2 loop controls to chat templates by @handshape in #2018
1011- fix: avoid cleanup errors for partially initialized ` LlamaModel ` objects by @usernames122 in #2173
1112- fix: suppress stdout and stderr in Jupyter notebooks by @Anai-Guo in #2181
1213- feat: enable arm64 musl builds by @acon96 in #2221
Original file line number Diff line number Diff line change @@ -223,7 +223,12 @@ def __init__(
223223 loader = jinja2 .BaseLoader (),
224224 trim_blocks = True ,
225225 lstrip_blocks = True ,
226- extensions = [Jinja2ChatFormatter .IgnoreGenerationTags ],
226+ # Keep this aligned with Transformers' chat-template Jinja extensions.
227+ # https://github.com/huggingface/transformers/blob/39603d0e5cdb6f00e8d473d7fcbb01032d709181/src/transformers/utils/chat_template_utils.py#L489-L490
228+ extensions = [
229+ Jinja2ChatFormatter .IgnoreGenerationTags ,
230+ jinja2 .ext .loopcontrols ,
231+ ],
227232 ).from_string (self .template )
228233
229234 @staticmethod
You can’t perform that action at this time.
0 commit comments