[gemma3] Add text-only runner for gemma-3-1B-it model#16885
[gemma3] Add text-only runner for gemma-3-1B-it model#16885seyeong-han wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16885
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 690d2dd with merge base ecc7dd0 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
I need to update this runner to utilize jinja format of chat-template similar to this PR |
Summary
This PR adds support for running the Gemma-3-1B-IT text-only model on ExecuTorch with CPU backend. The new
gemma3_text_runnerprovides a lightweight alternative to the existing multimodalgemma3_e2e_runner, without requiring image processing dependencies.Dependencies
The optimum-executorch PR modifies
utils.pyto include the<end_of_turn>token (ID 106) inget_eos_idsfor Gemma models. Without this change, the text runner will not stop generation at<end_of_turn>and will continue untilmax_new_tokensis reached.Changes
New Files
examples/models/gemma3/text_runner.cpp- Text-only inference runner with:<start_of_turn>user\n...<end_of_turn>\n<start_of_turn>model\n)Modified Files
examples/models/gemma3/CMakeLists.txt- Addedgemma3_text_runnerexecutable targetexamples/models/gemma3/CMakePresets.json- Addedgemma3-text-cpubuild and workflow presetsMakefile- Addedgemma3-text-cputargetexamples/models/gemma3/README.md- Comprehensive documentation for both modelsTest Plan
Result