[Model] Pass mm_features directly into get_mrope_input_positions (#28399)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-11-11 21:14:48 +08:00
committed by GitHub
parent 7dbe6d81d6
commit afffd3cc8a
15 changed files with 225 additions and 272 deletions
+13
View File
@@ -249,6 +249,19 @@ class MultiModalFeatureSpec:
mm_position: PlaceholderRange
"""e.g., PlaceholderRange(offset=2, length=336)"""
@staticmethod
def gather_kwargs(features: list["MultiModalFeatureSpec"], keys: set[str]):
kwargs = defaultdict[str, list[NestedTensors]](list)
for f in features:
item = f.data
if item is not None:
for k in keys:
if k in item:
kwargs[k].append(item[k].data)
return dict(kwargs)
@dataclass
class MultiModalFieldElem: