text-generation-inference icon indicating copy to clipboard operation
text-generation-inference copied to clipboard

[Feature] Support for general logit processors

Open lbeurerkellner opened this issue 2 years ago • 4 comments

Are there any plans to support logit processors via an additional API parameter? For instance, the OpenAI API provides a logit_bias parameter, that is applied to the token distribution during generation.

This would be great for http://github.com/eth-sri/lmql, where we heavily rely on token masking to enforce constraints during decoding.

Thank you for your hard work on this, it is an amazing project for the general inference space.

lbeurerkellner avatar Apr 25 '23 17:04 lbeurerkellner

Also very interested in this. For tasks like classification, it can be really useful to constrain the output to just some select logits. Especially when you want to have a "confidence" calculation

Vinno97 avatar Jun 20 '23 12:06 Vinno97

🤗 transformers just landed the SequenceBiasLogitsProcessor in their main branch, meaning this should be fairly straightforward to also implement here now as well!

Vinno97 avatar Jul 06 '23 14:07 Vinno97

Hi, am interested in this as well. Any chance of this being implemented?

AlvinNg89 avatar Jul 17 '23 06:07 AlvinNg89