[Misc] add enable_thinking to template kwargs#44817
[Misc] add enable_thinking to template kwargs#44817JJJYmmm wants to merge 3 commits intohuggingface:mainfrom
Conversation
|
Ah, this is interesting! cc @zucchini-nlp, the underlying problem here is that chat templates can accept arbitrary kwargs, but we don't have a good way of filtering those arbitrary kwargs out for e.g. tokenization. We probably want a more general solution than manually adding specific template kwargs to the list, right? |
|
Yep, also started noticing it after mistral4 release and pushing a proper PR today (if I have time) or tomorrow first priority. The root cause is as Matt said, because we used to call I'd prefer to not merge this PR yet |
|
Agree! That makes sense. In my latest commit, I use |
|
View the CircleCI Test Summary for this PR: https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=44817&sha=fd3850 |
|
Nice way for us to detect vars and support BC, thanks |
|
Closing this pr in favor of #44881. 🥂 |
What does this PR do?
Fix QwenLM/Qwen3.6#97.
This PR adds
enable_thinkingto the chat-template kwargs. With this change,enable_thinkingis treated as a template-level argument in the tokenize=True path, so it no longer leaks into processor call kwargs and triggers the “not a valid argument ... ignored” warning, while preserving existing thinking behavior.