Add image token budget example to Gemma 4 vision notebook - #250
siddhantoon wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request reorders notebook entries in the README and introduces an optional image token budget configuration in several Gemma 4 vision scripts. The feedback correctly identifies that the source Jupyter notebooks are missing from the PR, which is problematic as the modified Python scripts are auto-generated and will be overwritten. Additionally, the reviewer pointed out that moving the data collator import and instantiation into an optional section creates a dependency that will cause NameErrors if a user skips that section; suggestions were provided to move the import and instantiate the collator directly within the trainer setup to maintain modularity.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bccba0535
ℹ️ 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".
|
Updated all previous concerns raised for dependency import in optional cell. Re check @codex review |
|
The new cell sets the budget to 1120 right before the collator and trainer, so anyone running the notebook top to bottom trains with about four times the image tokens and may run out of memory on a free Colab GPU, could you leave the default in place and show the larger value only as a commented example? Also this edits the generated python_scripts/ copies and reorders unrelated Gemma4 rows in the README, so it would help to drop those and keep the change to the four vision notebooks. |
Added a small optional section to the Gemma 4 vision tutorial explaining image token budget.
It shows:
processor.image_processor.max_soft_tokensThis helps users understand when higher image token budgets may help for OCR and document intelligence tasks.