bridge.models.glm_vl.data.collate_fn#
GLM VL collator implementations.
Module Contents#
Functions#
Collate function for GLM-4.5V model. |
API#
- bridge.models.glm_vl.data.collate_fn.glm4v_collate_fn(
- examples: list,
- processor,
- *,
- visual_keys: object = None,
- min_pixels: int | None = None,
- max_pixels: int | None = None,
- sequence_length: int | None = None,
- pad_to_max_length: bool = False,
- pad_to_multiple_of: int = 128,
- enable_in_batch_packing: bool = False,
- in_batch_packing_pad_to_multiple_of: int = 1,
Collate function for GLM-4.5V model.
GLM-4.5V requires
mm_token_type_idsto distinguish image (1) and video (2) tokens from text (0) when computing 3D MRoPE positions. The processor returns this field by default (return_mm_token_type_ids=Truein Glm4vProcessor defaults). We wrap all visual tensors — includingmm_token_type_ids— in- Class:
GenericVisualInputsso they flow throughvlm_step.pyto the model.