vllm.renderers.hf ¶
_PROCESSOR_CHAT_TEMPLATES module-attribute ¶
Used in _try_get_processor_chat_template to avoid calling cached_get_processor again if the processor fails to be loaded.
This is needed because lru_cache does not cache when an exception happens.
build_video_prompts_from_mm_data ¶
build_video_prompts_from_mm_data(
mm_data: MultiModalDataDict,
) -> list[str]
Build video prompts from vision_chunk data.
Collects prompts from video chunks and groups them by video_idx.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm_data | MultiModalDataDict | Processed multimodal data with vision_chunk items | required |
Returns:
| Type | Description |
|---|---|
list[str] | List of video prompts, one per video. |
Source code in vllm/renderers/hf.py
rebuild_mm_uuids_from_mm_data ¶
rebuild_mm_uuids_from_mm_data(
mm_uuids: MultiModalUUIDDict,
mm_data: MultiModalDataDict,
) -> MultiModalUUIDDict
Rebuild mm_uuids after vision_chunk processing.
When videos are split into chunks, the original UUIDs need to be updated to reflect the new UUIDs generated for each chunk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm_uuids | MultiModalUUIDDict | Original UUIDs dictionary | required |
mm_data | MultiModalDataDict | Processed multimodal data with vision_chunk items | required |
Returns:
| Type | Description |
|---|---|
MultiModalUUIDDict | Updated UUIDs dictionary with chunk UUIDs |