Repository navigation
fix(tokenizer): enable add_bos_token for Gemma 4 base models - #8044
Closed
Souravrajvi0 wants to merge 3 commits into
Closed
Souravrajvi0 wants to merge 3 commits into
Souravrajvi0 wants to merge 3 commits into
Conversation
Souravrajvi0
marked this pull request as draft
August 6, 2026 16:51
Souravrajvi0
force-pushed
the
feat/gemma4-base-bos-token-8664
branch
2 times, most recently
from
August 13, 2026 05:02
ff06984 to
3cd461f
Compare
Gemma 4 base (non-it) unsloth Hub mirrors ship without add_bos_token: true even though google/gemma-4-* includes it. Without BOS, base-model inference degenerates into repeated text. Set add_bos_token at load time for the four base families (E2B, E4B, 31B, 26B-A4B) and their -unsloth-bnb-4bit variants. -it models are untouched because their chat templates already emit bos_token. Fixes unslothai#7903.
Co-authored-by: souravrajvidev-glitch <[email protected]>
Souravrajvi0
force-pushed
the
feat/gemma4-base-bos-token-8664
branch
from
August 15, 2026 07:01
3cd461f to
6d06ad0
Compare
Contributor
Author
|
Closing to reduce PR queue noise while maintainers are not actively reviewing. Happy to reopen a focused PR if there is interest in this fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gemma 4 base (non-it) unsloth Hub mirrors ship without add_bos_token: true even though google/gemma-4-* includes it. Without BOS, base-model inference degenerates into repeated text.
Set add_bos_token at load time for the four base families (E2B, E4B, 31B, 26B-A4B) and their -unsloth-bnb-4bit variants. -it models are untouched because their chat templates already emit bos_token.
Fixes #7903.