Update modeling_neollm.py
Browse files- modeling_neollm.py +6 -1
modeling_neollm.py
CHANGED
|
@@ -1210,7 +1210,12 @@ class NeoLLMForCausalLM(NeoLLMPreTrainedModel, GenerationMixin):
|
|
| 1210 |
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
| 1211 |
|
| 1212 |
self.post_init()
|
| 1213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1214 |
def forward(
|
| 1215 |
self,
|
| 1216 |
input_ids: Optional[torch.LongTensor] = None,
|
|
|
|
| 1210 |
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
| 1211 |
|
| 1212 |
self.post_init()
|
| 1213 |
+
def tie_weights(self):
|
| 1214 |
+
"""
|
| 1215 |
+
Tie the weights between the input embeddings and the output embeddings.
|
| 1216 |
+
Required for v5.0 compatibility.
|
| 1217 |
+
"""
|
| 1218 |
+
self._tie_or_clone_weights(self.lm_head, self.model.embed_tokens)
|
| 1219 |
def forward(
|
| 1220 |
self,
|
| 1221 |
input_ids: Optional[torch.LongTensor] = None,
|