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
dynamo
Commits
165f326d
Unverified
Commit
165f326d
authored
Jan 28, 2026
by
Qi Wang
Committed by
GitHub
Jan 28, 2026
Browse files
feat: add multimodal hasher to TRT-LLM (#5715)
parent
838ba140
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
components/src/dynamo/trtllm/multimodal/__init__.py
components/src/dynamo/trtllm/multimodal/__init__.py
+6
-0
components/src/dynamo/trtllm/multimodal/hasher.py
components/src/dynamo/trtllm/multimodal/hasher.py
+49
-0
No files found.
components/src/dynamo/trtllm/multimodal/__init__.py
0 → 100644
View file @
165f326d
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from
.hasher
import
MultimodalHasher
__all__
=
[
"MultimodalHasher"
]
components/src/dynamo/trtllm/multimodal/hasher.py
0 → 100644
View file @
165f326d
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Simple multimodal content hasher based on raw bytes using BLAKE3."""
from
blake3
import
blake3
class
MultimodalHasher
:
"""Hashes multimodal content (images, videos, etc.) based on raw bytes.
Fast and deterministic - no decoding overhead. Uses BLAKE3 for cryptographic
hashing of raw file bytes.
Note: Different file formats of the same visual content will produce different
hashes. This is by design - the hasher operates on raw bytes, not semantic content.
"""
@
staticmethod
def
hash_bytes
(
data
:
bytes
)
->
str
:
"""Hash raw bytes using BLAKE3.
Args:
data: Raw bytes to hash
Returns:
Hex digest string (64 characters for BLAKE3)
Example:
>>> hasher = MultimodalHasher()
>>> hash_result = hasher.hash_bytes(b"hello world")
>>> isinstance(hash_result, str)
True
>>> len(hash_result)
64
"""
return
blake3
(
data
).
hexdigest
()
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