You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
apply_chat_template receives generate-only options from _make_backend_specific_and_remove #1154
`_make_backend_specific_and_remove` is called at two `apply_chat_template` sites in `LocalHFBackend` (lines 805 and 1087 in `huggingface.py`) and its output is splatted directly into the tokenizer call. This means generate-only options such as `temperature`, `max_new_tokens`, and (since #1149) `do_sample` end up in the Jinja template's variable namespace.
HuggingFace templates silently ignore unknown kwargs, so there is no visible failure today. The risk is that a future template that happens to reference any of those names would be silently shadowed by user-supplied generation parameters, leading to unexpected rendering behaviour.
`_filter_chat_template_only_options` already strips template-only keys (e.g. `guardian_config`, `think`) before passing options to `generate()`. The inverse — stripping generate-only keys before passing to `apply_chat_template` — does not exist.
Activity
refactor: address code review feedback on generative-computing#1154 f…
fix(hf): replace generate-only denylist with Jinja AST allowlist
fix: strip generate-only options before apply_chat_template (generati…
refactor: address code review feedback on generative-computing#1154 f…
fix(hf): replace generate-only denylist with Jinja AST allowlist
fix(hf): filter model_options for apply_chat_template via Jinja AST a…