|
22 | 22 | from vllm.multimodal.parse import (ImageEmbeddingItems, ImageProcessorItems,
|
23 | 23 | ImageSize, MultiModalDataItems)
|
24 | 24 | from vllm.multimodal.processing import (BaseMultiModalProcessor,
|
25 |
| - BaseProcessingInfo, PromptReplacement, |
26 |
| - PromptUpdate) |
| 25 | + BaseProcessingInfo, MultiModalHashes, |
| 26 | + PromptReplacement, PromptUpdate) |
27 | 27 | from vllm.multimodal.profiling import BaseDummyInputsBuilder
|
28 | 28 | from vllm.sequence import IntermediateTensors
|
29 | 29 | from vllm.transformers_utils.configs.deepseek_vl2 import (DeepseekVLV2Config,
|
@@ -279,24 +279,26 @@ def _cached_apply_hf_processor(
|
279 | 279 | prompt: Union[str, list[int]],
|
280 | 280 | mm_data_items: MultiModalDataItems,
|
281 | 281 | hf_processor_mm_kwargs: Mapping[str, object],
|
282 |
| - ) -> tuple[list[int], MultiModalKwargs, bool]: |
| 282 | + *, |
| 283 | + return_mm_hashes: bool, |
| 284 | + ) -> tuple[list[int], MultiModalKwargs, Optional[MultiModalHashes], bool]: |
283 | 285 | # The processor logic is different for len(images) <= 2 vs > 2
|
284 | 286 | # Since the processing cache assumes that the processor output is
|
285 | 287 | # invariant of how many images are passed per prompt, we only
|
286 | 288 | # perform caching for the most common case
|
287 | 289 | if mm_data_items.get_count("image", strict=False) > 2:
|
288 |
| - # This code path corresponds to the cache being disabled |
289 |
| - return self._apply_hf_processor_main( |
| 290 | + return self._apply_hf_processor( |
290 | 291 | prompt=prompt,
|
291 |
| - mm_items=mm_data_items, |
| 292 | + mm_data_items=mm_data_items, |
292 | 293 | hf_processor_mm_kwargs=hf_processor_mm_kwargs,
|
293 |
| - enable_hf_prompt_update=True, |
| 294 | + return_mm_hashes=return_mm_hashes, |
294 | 295 | )
|
295 | 296 |
|
296 | 297 | return super()._cached_apply_hf_processor(
|
297 | 298 | prompt=prompt,
|
298 | 299 | mm_data_items=mm_data_items,
|
299 | 300 | hf_processor_mm_kwargs=hf_processor_mm_kwargs,
|
| 301 | + return_mm_hashes=return_mm_hashes, |
300 | 302 | )
|
301 | 303 |
|
302 | 304 |
|
|
0 commit comments