Skip to content

Add Gemma 4 support for E4B, 26B‑A4B, 31B - #30

Merged
armand0e merged 4 commits into
mainfrom
codex/gemma4-live-template-masking
Aug 25, 2026
Merged

Add Gemma 4 support for E4B, 26B‑A4B, 31B#30
armand0e merged 4 commits into
mainfrom
codex/gemma4-live-template-masking

Conversation

@armand0e

Copy link
Copy Markdown
Collaborator

Implemented and pushed live Gemma 4 support for:

Key fixes:

  • gemma4_example.py now uses each model’s live remote template by default instead of silently loading the stale local template.
  • <turn|> is now supervised as Gemma’s response terminator, without keeping reasoning-only or otherwise untrainable rows alive.
  • Added revision selection, gated-model HF_TOKEN forwarding, safe oversized-row trimming, current TRL processing_class, and the Unsloth zero-gradient workaround.
  • Live regression coverage checks masking and the thinking-generation prefix for all three models.
  • Current tested remote revisions:
    • E4B: ee0ef6023621cff504d758262d4e04895a5af4a2
    • 26B-A4B: 4d7ae4984b7db7de8f8457170b3f1a419ee76d52
    • 31B: 842da3794eaa0b77d5f08bae87a17459d91ff475

Verification:

  • Live tokenizer/template matrix: 4 passed
  • Full suite: 664 passed, 6 skipped
  • Focused masking suite: 100 passed
  • Ruff and mypy: clean
  • Verified tests import the checkout’s Teich 0.3.3

@armand0e armand0e self-assigned this Aug 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/teich/formatter.py Outdated
Comment on lines +1408 to +1414
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)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@armand0e
armand0e merged commit d30fcbf into main Aug 25, 2026
7 checks passed
@armand0e
armand0e deleted the codex/gemma4-live-template-masking branch August 25, 2026 00:56
@CompactAIOfficial CompactAIOfficial added enhancement New feature or request triaged labels Aug 30, 2026
@CompactAIOfficial CompactAIOfficial changed the title Gemma 4 masking Add Gemma 4 support for E4B, 26B‑A4B, 31B Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants