Skip to content

[Misc] Remove unused MultiModalHasher.hash_prompt_mm_data #19422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions vllm/multimodal/hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import pickle
from collections.abc import Iterable, Mapping
from typing import TYPE_CHECKING, Optional

import numpy as np
import torch
Expand All @@ -13,9 +12,6 @@
from vllm.logger import init_logger
from vllm.multimodal.image import convert_image_mode

if TYPE_CHECKING:
from vllm.inputs import TokensPrompt

logger = init_logger(__name__)

MultiModalHashDict = Mapping[str, list[str]]
Expand Down Expand Up @@ -91,28 +87,3 @@ def hash_kwargs(cls, **kwargs: object) -> str:
hasher.update(v_bytes)

return hasher.hexdigest()

@classmethod
def hash_prompt_mm_data(
cls, prompt: "TokensPrompt") -> Optional["MultiModalHashDict"]:
"""Hash multimodal data in the user input prompt if they exist."""

if "multi_modal_data" not in prompt:
return None

mm_data = prompt["multi_modal_data"]
if not mm_data:
# mm_data can be None or an empty dict.
return None

mm_items = {
modality: items if isinstance(items, list) else [items]
for modality, items in mm_data.items()
}

mm_hashes = {
modality: [cls.hash_kwargs(**{modality: item}) for item in items]
for modality, items in mm_items.items()
}

return mm_hashes