Python module
max.pipelines.modeling.dataprocessing
Batch collationโ
PaddingDirection | Padding (from) direction for batch collation. |
|---|
batch_padded_tokens_and_mask | Batches input tokens and computes a batched attention mask. |
|---|---|
collate_batch | Generates a single batch tensor from a batch of inputs. |
Attention masksโ
causal_attention_mask | Builds a causal attention mask for a batch of variable-length sequences. |
|---|---|
causal_attention_mask_with_token_mask | Builds a causal attention mask and additionally masks invalid tokens. |
Utilitiesโ
max_tokens_to_generate | Returns the maximum number of new tokens to generate. |
|---|
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!