Skip to content

Commit d328f42

Browse files
committed
.
1 parent 5933a34 commit d328f42

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

verl/workers/fsdp_workers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,12 @@ def _process_multi_modal_inputs(self, data: DataProto):
479479
else:
480480
multi_modal_inputs = {}
481481

482-
# Some image processor return with batch dim (such as glm4.1), we need to squeeze the pix_value.
483-
multi_modal_inputs['pixel_values'] = multi_modal_inputs['pixel_values'].squeeze(0)
482+
if multi_modal_inputs['pixel_values'].ndim() == 3:
483+
# Some image processor return with batch dim (such as glm4.1), we need to squeeze the pix_value.
484+
# i.e. (1,patch,pix_per_patch) -> (patch,pix_per_patch)
485+
multi_modal_inputs['pixel_values'] = multi_modal_inputs['pixel_values'].squeeze(0)
486+
487+
484488

485489
multi_modal_inputs_cache[index] = multi_modal_inputs
486490

0 commit comments

Comments
 (0)