Update modeling_neollm.py
Browse files- modeling_neollm.py +2 -10
modeling_neollm.py
CHANGED
|
@@ -1210,16 +1210,8 @@ 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 |
-
|
| 1215 |
-
Tie the weights between the input embeddings and the output embeddings.
|
| 1216 |
-
Required for v5.0 compatibility.
|
| 1217 |
-
|
| 1218 |
-
Args:
|
| 1219 |
-
missing_keys: List of missing keys from checkpoint loading (v5.0 parameter)
|
| 1220 |
-
recompute_mapping: Whether to recompute tied weights mapping (v5.0 parameter)
|
| 1221 |
-
"""
|
| 1222 |
-
self._tie_or_clone_weights(self.lm_head, self.model.embed_tokens)
|
| 1223 |
def forward(
|
| 1224 |
self,
|
| 1225 |
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 |
+
_tied_weights_keys = {"lm_head.weight": "model.embed_tokens.weight"}
|
| 1214 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1215 |
def forward(
|
| 1216 |
self,
|
| 1217 |
input_ids: Optional[torch.LongTensor] = None,
|