cerebras.modelzoo.data_preparation.data_preprocessing.tokenflow.utils.construct_attention_mask#

cerebras.modelzoo.data_preparation.data_preprocessing.tokenflow.utils.construct_attention_mask(datadict, eos_id, pad_id, input_key='input_ids')[source]#

Constructs attention masks based on the provided input_key in the datadict. The mask is constructed based on the presence of pad_id and eos_id.