outlines icon indicating copy to clipboard operation
outlines copied to clipboard

Add optional tokenizer paramers to generation

Open jkuntzer opened this issue 8 months ago • 2 comments

The title and the changes speak for themselves, I hope. In my case, this change was necessary to handle a bug with the Gemma 3 models whose fix involves passing additional parameters to the tokenizer when encoding the prompt. However, I think my changes allow for overall greater flexibility.

I didn't run the tests locally because it's a minimal change and I couldn't be bothered to install all of the additional libraries. I did run the pre-commit though and got no errors.

jkuntzer avatar Apr 11 '25 08:04 jkuntzer

Hi @jkuntzer, thanks for opening a PR! We are close to releasing the v1 of Outlines that will modify the interface of models. Would you mind testing out the models that cause this issue with the v1 branch please?

RobinPicard avatar Apr 13 '25 15:04 RobinPicard

Hi @RobinPicard, sure I can give it a try. However, the bug is not related to outlines; it's an inherent model problem in the transformers library, I believe. The problem was that I couldn't implement the fix in outlines.

jkuntzer avatar Apr 15 '25 09:04 jkuntzer