unsloth/tests/studio/load_freeze
Daniel Han fe37921223
Studio: fix load_freeze audio-type tests for #6000's Gemma 4 <|audio|> probe (#6018)
* Studio: fix load_freeze audio-type tests for #6000 Gemma 4 <|audio|> 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 <noreply@anthropic.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-06-05 07:15:45 -07:00
..
__init__.py studio: unblock /load event loop on detect_audio_type (#5642, #5635) (#5669) 2026-05-22 05:47:58 -07:00
llama_server_shim.py studio: unblock /load event loop on detect_audio_type (#5642, #5635) (#5669) 2026-05-22 05:47:58 -07:00
test_load_orchestrator.py Studio: fix load_freeze audio-type tests for #6000's Gemma 4 <|audio|> probe (#6018) 2026-06-05 07:15:45 -07:00