Skip to content

Conversation

@sayanshaw24
Copy link
Collaborator

@sayanshaw24 sayanshaw24 commented May 2, 2025

Sets add_special_tokens from OrtxTokenizeWithOptions added in microsoft/onnxruntime-extensions#940 to false to solve chat template issue in GenAI with extra BOS tokens.

See huggingface/transformers#37686 for more context.

@RyanUnderhill
Copy link
Contributor

Ok, meeting conclusion is that we don't need this API currently as our internal default values will do what users want. This way we avoid exposing an option that nobody knows what value to set to.

@sayanshaw24 sayanshaw24 changed the title Add API changes for Encode with special tokens Set add_special_tokens to false by default in Encode May 2, 2025
@sayanshaw24 sayanshaw24 marked this pull request as ready for review May 2, 2025 23:05
Copy link
Contributor

@RyanUnderhill RyanUnderhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you want to say in the PR comments why we default to false, just to have some history for it if we forget why we did this in the future.

@sayanshaw24
Copy link
Collaborator Author

Not sure if you want to say in the PR comments why we default to false, just to have some history for it if we forget why we did this in the future.

add_special_tokens from OrtxTokenizeWithOptions is a tokenizer param we set to false in Encode in GenAI so as to not confuse the user deciding what to set it to - setting it to false omits the extra BOS token added in the case of Gemma-3. See huggingface/transformers#37686 for more context.

@RyanUnderhill RyanUnderhill enabled auto-merge (squash) May 2, 2025 23:42
@RyanUnderhill RyanUnderhill merged commit 3a334c8 into main May 2, 2025
14 checks passed
@RyanUnderhill RyanUnderhill deleted the sayanshaw/special-tokens branch May 2, 2025 23:57
@natke natke added the 0.8.0 label May 3, 2025
RyanUnderhill added a commit that referenced this pull request May 6, 2025
Sets `add_special_tokens` from `OrtxTokenizeWithOptions` added in
microsoft/onnxruntime-extensions#940 to false to
solve chat template issue in GenAI with extra BOS tokens.

See huggingface/transformers#37686 for more
context.

---------

Co-authored-by: Sayan Shaw <[email protected]>
Co-authored-by: Ryan Hill <[email protected]>
baijumeswani added a commit that referenced this pull request May 6, 2025
Update version to 0.8.0-rc2 and cherry pick these 3 changes:

#1435 update ESRP settings
#1434 make WebGPU name consistent
#1432 Missed an all lowercase "webgpu" string
#1440 Apply provider name backwards compatibility at runtime
#1452 Update Extensions Commit to Support Chat Template Override for
Unsupported Models
#1439 Sign macos binaries
#1442 Set `add_special_tokens`

---------

Co-authored-by: Guenther Schmuelling <[email protected]>
Co-authored-by: Sayan Shaw <[email protected]>
Co-authored-by: Baiju Meswani <[email protected]>
Co-authored-by: Sayan Shaw <[email protected]>
Co-authored-by: kunal-vaishnavi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants