Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/mobius/integrations/ort_genai/auto_export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ class FakeConfig:
decoder = _mock_model_with_inputs(
[
"inputs_embeds",
"input_ids",
"per_layer_inputs",
"attention_mask",
"position_ids",
Comment thread
justinchuby marked this conversation as resolved.
"past_key_values.0.key",
Expand Down Expand Up @@ -1108,8 +1108,8 @@ def test_gemma4_vision_inputs(self, tmp_path):
assert "image_grid_thw" not in vision_inputs
assert data["model"]["vision"]["spatial_merge_size"] == 2

def test_gemma4_decoder_has_input_ids_and_inputs_embeds(self, tmp_path):
"""Gemma4 decoder has both inputs_embeds and input_ids."""
def test_gemma4_decoder_has_per_layer_inputs_and_inputs_embeds(self, tmp_path):
"""Gemma4 decoder has inputs_embeds and per_layer_inputs."""
pkg = self._make_gemma4_pkg()
path = _write_genai_config(
pkg.config,
Expand All @@ -1128,7 +1128,8 @@ def test_gemma4_decoder_has_input_ids_and_inputs_embeds(self, tmp_path):
data = json.load(f)
decoder_inputs = data["model"]["decoder"]["inputs"]
assert "inputs_embeds" in decoder_inputs
assert "input_ids" in decoder_inputs
assert "per_layer_inputs" in decoder_inputs
Comment thread
justinchuby marked this conversation as resolved.
assert "input_ids" not in decoder_inputs
# KV cache templates are present
assert decoder_inputs["past_key_names"] == "past_key_values.%d.key"

Expand Down Expand Up @@ -1342,7 +1343,7 @@ def test_gemma4_genai_config_from_real_model(self, tmp_path):
# Decoder inputs introspected from graph
decoder_inputs = data["model"]["decoder"]["inputs"]
assert "inputs_embeds" in decoder_inputs
assert "input_ids" in decoder_inputs
assert "input_ids" not in decoder_inputs
assert "attention_mask" in decoder_inputs
assert "position_ids" in decoder_inputs
assert decoder_inputs["past_key_names"] == ("past_key_values.%d.key")
Expand Down
Loading
Loading