[Bugfix] Allow Fish Speech phoneme-control tokens through normalize_fish_speech_text (#7043)

Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Co-authored-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
This commit is contained in:
Pujitha PaladuguandPujitha Paladugu authored and GitHub committed 2026-09-14 10:02:39 -07:00
1 parent 40f8e94400
commit 5f25d98652
3 files changed
+31 -1

No files matched your search

@@ -0,0 +1,23 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
import pytest
from vllm_omni.model_executor.models.fish_speech.prompt_utils import normalize_fish_speech_text
pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
def test_normalize_fish_speech_text_allows_phoneme_control_tokens():
text = "Deploy with <|phoneme_start|>K UW2 B ER0 N EH1 T IY0 Z<|phoneme_end|>."
assert normalize_fish_speech_text(text) == text
def test_normalize_fish_speech_text_rejects_unknown_control_token():
with pytest.raises(ValueError, match=r"unsupported control token\(s\): <\|foo\|>"):
normalize_fish_speech_text("<|foo|>hello")
def test_normalize_fish_speech_text_normalizes_legacy_speaker_tag():
assert normalize_fish_speech_text("<speaker:0>hello") == "<|speaker:0|>hello"