(self, input_ids, clip_skip=1)
| 62 | return mask |
| 63 | |
| 64 | def forward(self, input_ids, clip_skip=1): |
| 65 | embeds = self.token_embedding(input_ids) + self.position_embeds |
| 66 | attn_mask = self.attn_mask.to(device=embeds.device, dtype=embeds.dtype) |
| 67 | for encoder_id, encoder in enumerate(self.encoders): |
| 68 | embeds = encoder(embeds, attn_mask=attn_mask) |
| 69 | if encoder_id + clip_skip == len(self.encoders): |
| 70 | break |
| 71 | embeds = self.final_layer_norm(embeds) |
| 72 | return embeds |
| 73 | |
| 74 | @staticmethod |
| 75 | def state_dict_converter(): |