[MM] Cache common token sequences (#53560)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2026-08-24 07:48:10 -07:00
committed by GitHub
parent 4ca856b0b5
commit ecfa7bb373
14 changed files with 40 additions and 23 deletions
+2 -1
View File
@@ -81,6 +81,7 @@ from vllm.multimodal.processing import (
BaseProcessingInfo,
PromptReplacement,
PromptUpdate,
cached_encode,
)
from vllm.sequence import IntermediateTensors
from vllm.tokenizers import cached_tokenizer_from_config
@@ -691,7 +692,7 @@ class Qwen3ASRForConditionalGeneration(
full_lang_name = cls.supported_languages.get(lang_code, lang_code)
prompt += f"language {full_lang_name}{_ASR_TEXT_TAG}"
prompt_token_ids = tokenizer.encode(prompt)
prompt_token_ids = cached_encode(tokenizer, prompt)
return TokensPrompt(
prompt_token_ids=prompt_token_ids,