[Multimodal] Remove legacy multimodal fields in favor of MultiModalFeatureSpec (#24548)

Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
Flora Feng
2025-09-12 06:42:23 -07:00
committed by GitHub
parent 72fc8aa412
commit 0377802c20
13 changed files with 102 additions and 116 deletions

View File

@@ -86,7 +86,7 @@ class EncoderCacheManager:
Returns:
True if the encoder output for this input is already cached
"""
mm_hash = request.mm_hashes[input_id]
mm_hash = request.mm_features[input_id].identifier
# Not cached at all
if mm_hash not in self.cached:
return False
@@ -167,7 +167,7 @@ class EncoderCacheManager:
This method assumes can_allocate() returned True for the same input.
"""
mm_hash = request.mm_hashes[input_id]
mm_hash = request.mm_features[input_id].identifier
request_id = request.request_id
if mm_hash not in self.cached:
self.cached[mm_hash] = set()
@@ -193,8 +193,8 @@ class EncoderCacheManager:
"""
return {
input_id
for input_id in range(len(request.mm_hashes))
if request.mm_hashes[input_id] in self.cached
for input_id in range(len(request.mm_features))
if request.mm_features[input_id].identifier in self.cached
}
def free_encoder_input(self, request: Request, input_id: int) -> None:
@@ -208,7 +208,7 @@ class EncoderCacheManager:
`can_allocate`).
"""
req_id = request.request_id
mm_hash = request.mm_hashes[input_id]
mm_hash = request.mm_features[input_id].identifier
# The mm_hash not in cache or the req_id set is empty
if not self.cached.get(mm_hash, None):
return