Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jinja2cpp: update submodule for 'not X is defined' fix #3402

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

cebtenzzre
Copy link
Member

It turns out that the reason #3372 was needed was that if not add_generation_prompt is defined was meant to be parsed as if not (add_generation_prompt is defined), which is how it works in Jinja2Cpp and also how those operators work in the Python language itself ('is' binds more strongly than 'not').

But Jinja2Cpp parsed that as if (not add_generation_prompt) is defined, which when read that way is nonsense—it will always be true, so the conditional will always be executed.

With this change, the operator precedence is corrected, so Jinja2Cpp is able to interpret these expressions in the expected manner. This leaves list slicing as the primary limitation preventing Jinja2Cpp from being compatible with most prompt templates.

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
@cebtenzzre cebtenzzre marked this pull request as ready for review January 21, 2025 22:16
@cebtenzzre cebtenzzre requested a review from manyoso January 21, 2025 22:16
@manyoso manyoso merged commit 4a8a51f into main Jan 21, 2025
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants