[Bugfix] Decode Tokenized IDs to Strings for hf_processor in llm.chat() with model_impl=transformers (#21353)

Signed-off-by: ariG23498 <aritra.born2fly@gmail.com>
This commit is contained in:
Aritra Roy Gosthipaty
2025-07-22 20:57:28 +05:30
committed by GitHub
parent 44554a0068
commit 2226d5bd85
2 changed files with 45 additions and 0 deletions

View File

@@ -320,6 +320,11 @@ class MultiModalProcessor(BaseMultiModalProcessor[MultiModalProcessingInfo]):
mm_items = self._to_mm_items(mm_data)
hf_processor = self.info.get_hf_processor(**hf_processor_mm_kwargs)
if not isinstance(prompt, str):
# the prompt is the tokenized ids which is not supported
# by the hf_processor, which is why we would need to decode the ids
# into string
prompt = hf_processor.decode(prompt)
(prompt_ids, processed_data,
mm_token_type_ids) = self._apply_hf_processor_text_mm(