bridge.data.collators.sequence#

Explicit collator policy for padded or in-batch-packed sequence output.

Module Contents#

Functions#

prepare_sequence_batch

Apply the collator’s explicit padded or in-batch-packed output policy.

API#

bridge.data.collators.sequence.prepare_sequence_batch(
batch: collections.abc.MutableMapping[str, Any],
*,
sequence_length: int | 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,
pad_token_id: int = 0,
ignore_index: int = IGNORE_INDEX,
sequence_tensor_pad_values: collections.abc.Mapping[str, int | float] | None = None,
) None#

Apply the collator’s explicit padded or in-batch-packed output policy.