Download model/embedding.py from KiranAN1988/NeemSutra-125M-Python-Instruct-Beta: direct link, hf CLI and curl.
- Browser
- Download file 385 Bytes
-
https://huggingface.co/KiranAN1988/NeemSutra-125M-Python-Instruct-Beta/resolve/main/model/embedding.py
- Command line
-
hf download hf://KiranAN1988/NeemSutra-125M-Python-Instruct-Beta/model/embedding.py
-
curl -L -o embedding.py https://huggingface.co/KiranAN1988/NeemSutra-125M-Python-Instruct-Beta/resolve/main/model/embedding.py
385 Bytes
| import torch.nn as nn | |
| class TokenEmbedding(nn.Module): | |
| def __init__( | |
| self, | |
| vocab_size, | |
| embedding_dim | |
| ): | |
| super().__init__() | |
| self.embedding = nn.Embedding( | |
| vocab_size, | |
| embedding_dim | |
| ) | |
| def forward(self, input_ids): | |
| return self.embedding( | |
| input_ids | |
| ) |