[VLM][Core] Fix exceptions on ragged NestedTensors (#7974)
This commit is contained in:
@@ -54,8 +54,8 @@ class MultiModalInputs(_MultiModalInputsBase):
|
||||
return nested_tensors
|
||||
|
||||
stacked = [MultiModalInputs._try_stack(t) for t in nested_tensors]
|
||||
if is_list_of(stacked, list):
|
||||
# Do not stack nested lists
|
||||
if not is_list_of(stacked, torch.Tensor, check="all"):
|
||||
# Only tensors (not lists) can be stacked.
|
||||
return stacked
|
||||
|
||||
tensors_ = cast(List[torch.Tensor], stacked)
|
||||
|
||||
Reference in New Issue
Block a user