Skip to content

Commit a370b9c

Browse files
justinchubyCopilot
andcommitted
fix: keep processor_config.json naming convention for all VLMs
The config_filename is read from genai_config.json at runtime — ORT GenAI/extensions don't hardcode the filename. Keep the existing processor_config.json convention for consistency across all VLMs. Co-authored-by: Copilot <[email protected]> Signed-off-by: Justin Chu <[email protected]>
1 parent e170a4d commit a370b9c

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

‎examples/gemma4/ort_genai/vlm/genai_config.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
},
5959
"vision": {
6060
"filename": "vision.onnx",
61-
"config_filename": "image_processor.json",
61+
"config_filename": "processor_config.json",
6262
"spatial_merge_size": 2,
6363
"session_options": {
6464
"log_id": "onnxruntime-genai",
File renamed without changes.

‎src/mobius/integrations/ort_genai/auto_export.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,13 @@ def _write_processor_config(
190190
"tokens_per_image": tokens_per_image,
191191
}
192192
}
193-
# ORT-extensions expects image_processor.json for Gemma4
194-
proc_filename = "image_processor.json"
195193
else:
196194
processor = {
197195
"image_size": getattr(vision, "image_size", None) or 448,
198196
"patch_size": getattr(vision, "patch_size", None) or 14,
199197
}
200-
proc_filename = "processor_config.json"
198+
199+
proc_filename = "processor_config.json"
201200

202201
path = os.path.join(output_dir, proc_filename)
203202
with open(path, "w", encoding="utf-8") as f:
@@ -281,7 +280,6 @@ def _write_genai_config(
281280
vision_cfg = getattr(config, "vision", None)
282281
sms = getattr(vision_cfg, "spatial_merge_size", 2)
283282
vision_kwargs["spatial_merge_size"] = sms
284-
vision_kwargs["config_filename"] = "image_processor.json"
285283

286284
if vision_input_mapping is not None:
287285
vision_kwargs["input_names"] = vision_input_mapping

‎src/mobius/integrations/ort_genai/auto_export_test.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ def test_gemma4_genai_config_from_real_model(self, tmp_path):
780780
# Config-level properties are still present
781781
assert data["model"]["image_token_id"] == 255999
782782
assert data["model"]["vision"]["spatial_merge_size"] == 2
783-
assert data["model"]["vision"]["config_filename"] == "image_processor.json"
783+
assert data["model"]["vision"]["config_filename"] == "processor_config.json"
784784

785785
def test_auto_export_produces_genai_config(self, tmp_path):
786786
"""Mock build() to return a tiny package, verify genai_config."""

0 commit comments

Comments
 (0)