You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Fix Gemma4 ORT GenAI config generation to produce correct
genai_config.json and processor_config.json.
## Changes
### 1. Vision inputs (auto_export.py)
Gemma4 uses `pixel_values + pixel_position_ids` (not `image_grid_thw`).
Added Gemma4-specific branch in `_write_genai_config()` that sets the
correct input names and disables `spatial_merge_size`.
### 2. Decoder input_ids (genai_config.py)
Gemma4 decoders need `input_ids` alongside `inputs_embeds` for per-layer
token embeddings (E2B architecture). Added `with_extra_decoder_inputs()`
method to `GenaiConfigGenerator` and wired it for Gemma4 in
`_write_genai_config()`.
### 3. Processor config (auto_export.py)
Updated `_write_processor_config()` to detect Gemma4 and write the
correct format with `name`, `tokens_per_image`, `mean`, and `std` fields
wrapped under a `processor` key, matching the ort-extensions expected
format.
### 4. Reference config updated
Added `input_ids` to decoder inputs in
`examples/gemma4/ort_genai/vlm/genai_config.json`.
## Testing
- All 85 ORT GenAI tests pass
- All 12 Gemma4 build graph tests pass
- Full test suite: 2557 passed, 41 skipped
- Linter clean
---------
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments