Repository navigation
Studio: fix load_freeze audio-type tests for #6000's Gemma 4 <|audio|> probe - #6018
Merged
Merged
Conversation
…probe #6000 extended LlamaCppBackend._detect_audio_type_strict audio_vlm arm to also probe Gemma 4 `<|audio|>` (alongside Gemma 3n `<audio_soft_token>`), but did not update the load_freeze simulation suite (last touched by #5922). Its "no-match" and "bicodec" fixtures only defeat `<audio_soft_token>`; the unmapped `<|audio|>` probe falls through to FakeLlamaServer 1-token default, so detect_audio_type now returns audio_vlm where these tests expect None / bicodec: - test_functional_equivalence_no_match - test_functional_equivalence_bicodec_match - test_response_shape_matches_pre_fix_for_no_match main push-CI does not run "Repo tests (CPU)" (pull_request-only), so this surfaces in every open PR merge-ref (e.g. #5940, which is unrelated to audio). Fix: map `<|audio|>` to a 2-token response in the three fixtures that intend a non-audio_vlm result (restoring their original semantics), and add a positive test_functional_equivalence_audio_vlm_match locking in #6000 new `<|audio|>` detection. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the test suite in test_load_orchestrator.py to add a new functional equivalence test (test_functional_equivalence_audio_vlm_match) verifying the behavior of the Gemma 4 <|audio|> probe. It also updates existing tests to include the <|audio|> token in their mock token response maps. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Update the
load_freezesimulation suite (tests/studio/load_freeze/test_load_orchestrator.py) so it reflects the audio-detection behavior introduced by #6000.Why
#6000 ("Studio: enable audio input for Gemma 4 GGUFs") extended
LlamaCppBackend._detect_audio_type_strict'saudio_vlmarm to also probe Gemma 4's<|audio|>token, in addition to Gemma 3n's<audio_soft_token>:That change is correct, but #6000 did not update this test file (last touched by #5922). Its "no-match" and "bicodec" fixtures only mapped
<audio_soft_token>to a 2-token response to defeat the (pre-#6000) Gemma 3n arm. The new<|audio|>probe is left unmapped, so it falls through toFakeLlamaServer's default (tokens = list(range(max(1, len(content.split()) or 1)))→ 1 token for a no-whitespace marker), which now satisfies theaudio_vlmcheck.As a result three equivalence/shape tests fail on
main(4c06c1d), all becausedetect_audio_typenow returns'audio_vlm':test_functional_equivalence_no_match— expectedNonetest_functional_equivalence_bicodec_match— expected'bicodec'(audio_vlm matches before bicodec in detection order)test_response_shape_matches_pre_fix_for_no_match— expected{'audio_type': None}This isn't caught by
main's push-CI because "Repo tests (CPU)" only runs onpull_request, so the breakage surfaces in every open PR's merge-ref (e.g. it's currently red on the unrelated AMD installer PR #5940).Fix
Touches only the test file:
<|audio|>to a 2-token response in the three fixtures whose intent is a non-audio_vlmoutcome (shim_no_match, the bicodec fixture, and thetest_response_shape_matches_pre_fix_for_no_matchfixture). This restores their original semantics now that<|audio|>is a probed marker — exactly mirroring how they already defeat<audio_soft_token>.test_functional_equivalence_audio_vlm_matchthat keeps<audio_soft_token>at 2 tokens and sets<|audio|>to 1 token, so it specifically exercises and locks in Studio: enable audio input for Gemma 4 GGUFs; default chat model to Qwen3.5-4B-MTP #6000's new Gemma 4<|audio|>arm (sync ==to_threadlike the other per-codec cases).Test
🤖 Generated with Claude Code