vllm_omni.model_executor.models.indextts2.prompt_utils ¶
Prompt helpers for IndexTTS2 talker prefill.
build_indextts2_prefill_prompt_ids ¶
build_indextts2_prefill_prompt_ids(
model_id_or_path: str,
text: str,
*,
model_type: str = "indextts2",
lang: str = "zh",
text_normalization: bool = True,
tokenizer_file: str = INDEXTTS25_TOKENIZER_FILE,
placeholder_token_id: int = 1,
) -> list[int]
estimate_indextts2_prefill_prompt_len ¶
estimate_indextts2_prefill_prompt_len(
model_id_or_path: str,
text: str,
*,
model_type: str = "indextts2",
lang: str = "zh",
text_normalization: bool = True,
tokenizer_file: str = INDEXTTS25_TOKENIZER_FILE,
) -> int
Return the placeholder prompt length expected by the IndexTTS2 talker.
IndexTTS 2 uses 34 conditioning tokens. IndexTTS 2.5 uses one projected CAMPPlus speaker token followed by two zero tokens.