| 416 | |
| 417 | class LLaMAMLP(nn.Module): |
| 418 | def __init__(self, config: Config) -> None: |
| 419 | super().__init__() |
| 420 | # self.fc_1 = nn.Linear(config.n_embd, config.intermediate_size, bias=config.bias) |
| 421 | # self.fc_2 = nn.Linear(config.n_embd, config.intermediate_size, bias=config.bias) |
| 422 | # self.proj = nn.Linear(config.intermediate_size, config.n_embd, bias=config.bias) |
| 423 | self.swiglu = SwiGLU( |
| 424 | config.n_embd, config.intermediate_size, bias=False, _pack_weights=False |
| 425 | ) |
| 426 | |
| 427 | def forward(self, x: torch.Tensor) -> torch.Tensor: |
| 428 | # x_fc_1 = self.fc_1(x) |