Download model/mlp.py from KiranAN1988/NeemSutra-125M-Python-Instruct-Beta: direct link, hf CLI and curl.
- Browser
- Download file 569 Bytes
-
https://huggingface.co/KiranAN1988/NeemSutra-125M-Python-Instruct-Beta/resolve/main/model/mlp.py
- Command line
-
hf download hf://KiranAN1988/NeemSutra-125M-Python-Instruct-Beta/model/mlp.py
-
curl -L -o mlp.py https://huggingface.co/KiranAN1988/NeemSutra-125M-Python-Instruct-Beta/resolve/main/model/mlp.py
569 Bytes
| import torch.nn as nn | |
| class FeedForward(nn.Module): | |
| def __init__( | |
| self, | |
| d_model, | |
| dropout=0.1 | |
| ): | |
| super().__init__() | |
| self.network = nn.Sequential( | |
| nn.Linear( | |
| d_model, | |
| 4 * d_model | |
| ), | |
| nn.GELU(), | |
| nn.Linear( | |
| 4 * d_model, | |
| d_model | |
| ), | |
| nn.Dropout( | |
| dropout | |
| ) | |
| ) | |
| def forward(self, x): | |
| return self.network(x) |