Add Gemma 4 support for E4B, 26B‑A4B, 31B - #30
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de9b79cd56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| has_selected_content = any( | ||
| text[max(start, match.end()) : min(end, turn_end)].strip() | ||
| for start, end in selected | ||
| if start < turn_end and end > match.end() | ||
| ) | ||
| if not has_selected_content: | ||
| orphaned_turn_ends.append((turn_end, turn_end + len(_GEMMA_TURN_END))) |
There was a problem hiding this comment.
Retain the terminator for non-final Gemma targets
When train_on_final_answers=False but reasoning or tool-call supervision remains enabled, the <turn|> span has already been classified as final_answer and removed from selected before this check. has_selected_content therefore sees the remaining target, but this block can only remove a terminator and never restore it, so reasoning-only or tool-only Gemma turns do not learn the stopping token despite containing an enabled training target. Preserve the terminator whenever this check finds selected content, independently of the final-answer flag.
Useful? React with 👍 / 👎.
Implemented and pushed live Gemma 4 support for:
Key fixes:
<turn|>is now supervised as Gemma’s response terminator, without keeping reasoning-only or otherwise untrainable rows alive.HF_TOKENforwarding, safe oversized-row trimming, current TRLprocessing_class, and the Unsloth zero-gradient workaround.ee0ef6023621cff504d758262d4e04895a5af4a24d7ae4984b7db7de8f8457170b3f1a419ee76d52842da3794eaa0b77d5f08bae87a17459d91ff475Verification:
4 passed664 passed, 6 skipped100 passed