Skip to content

Commit f1e51fc

Browse files
committed
fix lint
1 parent f1ff6b4 commit f1e51fc

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ def _write_genai_config(
355355
model_type = getattr(config, "model_type", "")
356356
if model_type in _GEMMA4_MODEL_TYPES:
357357
vision_cfg = getattr(config, "vision", None)
358-
vision_kwargs["spatial_merge_size"] = getattr(vision_cfg, "spatial_merge_size", 2)
358+
vision_kwargs["spatial_merge_size"] = getattr(
359+
vision_cfg, "spatial_merge_size", 2
360+
)
359361
elif has_speech:
360362
vision_kwargs["spatial_merge_size"] = None
361363

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ def test_audio_gemma4_writes_feature_extraction_json(self, tmp_path):
125125
attrs = seq[1]["operation"]["attrs"]
126126
assert attrs["feature_size"] == 128
127127
assert attrs["sampling_rate"] == 16000
128-
assert attrs["frame_length_ms"] == 20.0
129-
assert attrs["hop_length_ms"] == 10.0
130-
assert attrs["mel_floor"] == 0.001
128+
assert attrs["frame_length_ms"] == 20.0 # noqa: RUF069
129+
assert attrs["hop_length_ms"] == 10.0 # noqa: RUF069
130+
assert attrs["mel_floor"] == 0.001 # noqa: RUF069
131131

132132

133133
class TestCopyTokenizerFiles:
@@ -472,7 +472,7 @@ class FakeConfig:
472472
assert op1["type"] == "Gemma4LogMel"
473473
assert op1["attrs"]["feature_size"] == 128
474474
assert op1["attrs"]["sampling_rate"] == 16000
475-
assert op1["attrs"]["mel_floor"] == 0.001
475+
assert op1["attrs"]["mel_floor"] == 0.001 # noqa: RUF069
476476

477477
def test_gemma4_audio_processor_not_written_without_audio(self, tmp_path):
478478
"""No audio_feature_extraction.json when config has no audio attr."""
@@ -534,7 +534,9 @@ class FakeConfig:
534534
data = json.load(f)
535535

536536
# Speech section must exist
537-
assert "speech" in data["model"], "genai_config.json should have a speech section for Gemma4 with audio_encoder"
537+
assert "speech" in data["model"], (
538+
"genai_config.json should have a speech section for Gemma4 with audio_encoder"
539+
)
538540
speech = data["model"]["speech"]
539541

540542
# config_filename must point to the onnxruntime-extensions audio config

0 commit comments

Comments
 (0)