[Feature] Extend CustomLogitProcessor to Support input_ids in call Method
Checklist
- [ ] 1. If the issue you raised is not a feature but a question, please raise a discussion at https://github.com/sgl-project/sglang/discussions/new/choose Otherwise, it will be closed.
- [x] 2. Please use English, otherwise it will be closed.
Motivation
Thanks @hongpeng-guo for PR #2396. After reviewing your work, I'd like to propose an enhancement to the CustomLogitProcessor. Specifically, I suggest modifying its __call__ method to accept input_ids as an additional parameter—similar to the implementation in Huggingface (see this doc). This change would allow constraints to be applied conditionally based on the entire history of input tokens, enabling more flexible and context-aware processing.
Thank you for considering this feature request!
Related resources
Thank you for your suggestion! You are welcome to raise a new PR to realize the enhancement as you mentioned.
@Aykhan-sh Thanks for your suggestions. It makes a lot of sense to include input_ids as an extra args. I am thinking about if it's necessary to also include args and kwargs to make this function more flexible. But for now, let's just align with the HuggingFace API.
Feel free to start a PR and assign me as a reviewer if you have time. Otherwise, I can take this issue later this week.
Any progress on this?
+1 I observe QwQ may sometimes generate multiple
This issue has been automatically closed due to inactivity. Please feel free to reopen it if needed.
Why was it closed?