Commit f945dad
✨ Add block assignment functionality in
This PR implements functionality of block assignments
(https://jinja.palletsprojects.com/en/stable/templates/#block-assignments)
in lexer, parser and engine=
I felt encouraged by the reply here:
#1087 (comment)
It was necessary to parse some chat_templates e.g.
https://huggingface.co/MadeAgents/Hammer2.1-1.5b/blob/main/tokenizer_config.json
(nicely formatted `chat_template`: https://pastebin.com/xBmhbwLi)
Let me know if you have any feedback.
---------
Co-authored-by: Joshua Lochner <[email protected]>
Co-authored-by: Joshua Lochner <[email protected]>jinja package. (#1341)1 parent 0cbd641 commit f945dad
File tree
6 files changed
+61
-5
lines changed- packages/jinja
- src
- test
6 files changed
+61
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
135 | 149 | | |
136 | | - | |
| 150 | + | |
137 | 151 | | |
138 | | - | |
139 | 152 | | |
140 | 153 | | |
141 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| 590 | + | |
| 591 | + | |
590 | 592 | | |
591 | 593 | | |
592 | 594 | | |
| |||
916 | 918 | | |
917 | 919 | | |
918 | 920 | | |
919 | | - | |
| 921 | + | |
920 | 922 | | |
921 | 923 | | |
922 | 924 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
705 | 707 | | |
706 | 708 | | |
707 | 709 | | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
708 | 723 | | |
709 | 724 | | |
710 | 725 | | |
| |||
1682 | 1697 | | |
1683 | 1698 | | |
1684 | 1699 | | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
1685 | 1707 | | |
1686 | 1708 | | |
1687 | 1709 | | |
| |||
3038 | 3060 | | |
3039 | 3061 | | |
3040 | 3062 | | |
| 3063 | + | |
3041 | 3064 | | |
3042 | 3065 | | |
3043 | 3066 | | |
| |||
3173 | 3196 | | |
3174 | 3197 | | |
3175 | 3198 | | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
3176 | 3202 | | |
3177 | 3203 | | |
3178 | 3204 | | |
| |||
3300 | 3326 | | |
3301 | 3327 | | |
3302 | 3328 | | |
| 3329 | + | |
3303 | 3330 | | |
3304 | 3331 | | |
3305 | 3332 | | |
| |||
3353 | 3380 | | |
3354 | 3381 | | |
3355 | 3382 | | |
| 3383 | + | |
3356 | 3384 | | |
3357 | 3385 | | |
3358 | 3386 | | |
| |||
0 commit comments