Skip to content

Feat/add gemma4 support#199

Open
EvineR666 wants to merge 4 commits into
modelscope:mainfrom
EvineR666:feat/add-gemma4-support
Open

Feat/add gemma4 support#199
EvineR666 wants to merge 4 commits into
modelscope:mainfrom
EvineR666:feat/add-gemma4-support

Conversation

@EvineR666
Copy link
Copy Markdown

@EvineR666 EvineR666 commented May 20, 2026

PR type

  • [√] Bug Fix
  • New Feature
  • Document Updates
  • [√] More Models or Datasets Support

PR information

This PR mainly contains two changes:

  1. Add full support for Google Gemma4 series models (require transformers>=5.5.0 dependency)
  2. Fix the bug that Template could not correctly process multimodal data in messages

Experiment results

Paste your experiment result here(if needed).

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for Gemma4 models by adding a new template and a cookbook example for multimodal FSDP2 training. It also refactors the base template's pipeline execution to use method names for better compatibility. Feedback includes fixing a copy-paste error in the evaluation dataset mapping, moving general multimodal processing logic to the base template, and improving code quality through consistent logging, removal of unused imports, and the addition of a training progress bar.

Comment thread cookbook/mm/fsdp2_gemma4_mm.py Outdated
Comment thread src/twinkle/template/gemma4.py Outdated
Comment thread cookbook/mm/fsdp2_gemma4_mm.py Outdated
Comment thread cookbook/mm/fsdp2_gemma4_mm.py Outdated
Comment thread cookbook/mm/fsdp2_gemma4_mm.py Outdated
Comment thread src/twinkle/template/base.py Outdated
Comment thread src/twinkle/template/gemma4.py Outdated
Comment thread src/twinkle/template/gemma4.py Outdated
@EvineR666 EvineR666 marked this pull request as ready for review May 20, 2026 09:06
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个类是否有存在的必要

@tpx818
Copy link
Copy Markdown
Collaborator

tpx818 commented May 21, 2026

请在readme中补充gemma4的支持

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants