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
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.
The text was updated successfully, but these errors were encountered:
Aykhan-sh
changed the title
[Feature] Extend CustomLogitProcessor to Support nput_ids in call Method
[Feature] Extend CustomLogitProcessor to Support input_ids in call Method
Feb 12, 2025
@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.
Checklist
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 acceptinput_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
Huggingface LogitsProcessor.
The text was updated successfully, but these errors were encountered: