(
self,
hidden_states,
attention_mask,
cu_seqlens=None,
max_seq_len=None,
)
| 474 | return layers |
| 475 | |
| 476 | def forward( |
| 477 | self, |
| 478 | hidden_states, |
| 479 | attention_mask, |
| 480 | cu_seqlens=None, |
| 481 | max_seq_len=None, |
| 482 | ): |
| 483 | |
| 484 | if max_seq_len is not None and not isinstance(max_seq_len, torch.Tensor): |
| 485 | max_seq_len = torch.tensor(max_seq_len, dtype=torch.int32, device="cpu") |
| 486 | |
| 487 | for lid, layer in enumerate(self.layers): |
| 488 | hidden_states = layer( |
| 489 | hidden_states, |
| 490 | attention_mask, |
| 491 | cu_seqlens, |
| 492 | max_seq_len, |
| 493 | ) |
| 494 | return hidden_states |
| 495 | |
| 496 | |
| 497 | class Step1Model(PreTrainedModel): |
nothing calls this directly
no outgoing calls
no test coverage detected