Skip to content

Commit c455a28

Browse files
DarkLight1337mzusman
authored andcommitted
[Model] Future-proof Qwen2-Audio multi-modal processor (vllm-project#11776)
Signed-off-by: DarkLight1337 <[email protected]>
1 parent 79245f7 commit c455a28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vllm/model_executor/models/qwen2_audio.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,14 @@ def get_replacement_qwen2_audio(item_idx: int):
227227
]
228228

229229
def _always_apply_prompt_replacements(self) -> bool:
230-
# HF never applies prompt replacements, so we have to do it ourselves.
230+
# Qwen2-Audio processor will start inserting placeholder tokens
231+
# in an upcoming release:
232+
# https://github.com/huggingface/transformers/pull/35534
231233
# NOTE: `_find_placeholders_by_modality` may incorrectly think that HF
232234
# has already performed processing for multi-audio input when the input
233235
# audios are short (the corresponding placeholders may take up fewer
234236
# tokens than the number of audio items)
235-
return True
237+
return not hasattr(self._get_hf_processor(), "audio_token")
236238

237239

238240
@MULTIMODAL_REGISTRY.register_processor(Qwen2AudioMultiModalProcessor)

0 commit comments

Comments
 (0)