[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user