Skip to content

Commit

Permalink
[Model] Future-proof Qwen2-Audio multi-modal processor (#11776)
Browse files Browse the repository at this point in the history
Signed-off-by: DarkLight1337 <[email protected]>
  • Loading branch information
DarkLight1337 authored Jan 7, 2025
1 parent 08fb75c commit d0169e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vllm/model_executor/models/qwen2_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,14 @@ def get_replacement_qwen2_audio(item_idx: int):
]

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


@MULTIMODAL_REGISTRY.register_processor(Qwen2AudioMultiModalProcessor)
Expand Down

0 comments on commit d0169e1

Please sign in to comment.