Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
96ada386
Unverified
Commit
96ada386
authored
Jun 11, 2025
by
Lukas Geiger
Committed by
GitHub
Jun 11, 2025
Browse files
[Misc] Remove unused `MultiModalHasher.hash_prompt_mm_data` (#19422)
Signed-off-by:
Lukas Geiger
<
lukas.geiger94@gmail.com
>
parent
1e473b30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
29 deletions
+0
-29
vllm/multimodal/hasher.py
vllm/multimodal/hasher.py
+0
-29
No files found.
vllm/multimodal/hasher.py
View file @
96ada386
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
import
pickle
import
pickle
from
collections.abc
import
Iterable
,
Mapping
from
collections.abc
import
Iterable
,
Mapping
from
typing
import
TYPE_CHECKING
,
Optional
import
numpy
as
np
import
numpy
as
np
import
torch
import
torch
...
@@ -13,9 +12,6 @@ from PIL import Image
...
@@ -13,9 +12,6 @@ from PIL import Image
from
vllm.logger
import
init_logger
from
vllm.logger
import
init_logger
from
vllm.multimodal.image
import
convert_image_mode
from
vllm.multimodal.image
import
convert_image_mode
if
TYPE_CHECKING
:
from
vllm.inputs
import
TokensPrompt
logger
=
init_logger
(
__name__
)
logger
=
init_logger
(
__name__
)
MultiModalHashDict
=
Mapping
[
str
,
list
[
str
]]
MultiModalHashDict
=
Mapping
[
str
,
list
[
str
]]
...
@@ -91,28 +87,3 @@ class MultiModalHasher:
...
@@ -91,28 +87,3 @@ class MultiModalHasher:
hasher
.
update
(
v_bytes
)
hasher
.
update
(
v_bytes
)
return
hasher
.
hexdigest
()
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment