KristianS7
/

KristianS7 commited on
Commit
09d3a07
·
verified ·
1 Parent(s): 880ce86

Update tied weight metadata for Transformers 5

Browse files

Transformers 5 expects `_tied_weights_keys` to be a target-to-source mapping.

This mirrors the built-in Qwen3/Qwen3.5 remote-code pattern and keeps Ouro compatible if `tie_word_embeddings` is enabled. With the default `tie_word_embeddings=False`, the mapping remains inert.

Files changed (1) hide show
  1. modeling_ouro.py +1 -1
modeling_ouro.py CHANGED
@@ -605,7 +605,7 @@ class _FP32LMHead(nn.Module):
605
 
606
 
607
  class OuroForCausalLM(OuroPreTrainedModel, GenerationMixin):
608
- _tied_weights_keys = ["lm_head.weight"]
609
  _tp_plan = {"lm_head": "colwise_rep"}
610
  _pp_plan = {"lm_head": (["hidden_states"], ["logits"])}
611
 
 
605
 
606
 
607
  class OuroForCausalLM(OuroPreTrainedModel, GenerationMixin):
608
+ _tied_weights_keys = {"lm_head.weight": "model.embed_tokens.weight"}
609
  _tp_plan = {"lm_head": "colwise_rep"}
610
  _pp_plan = {"lm_head": (["hidden_states"], ["logits"])}
611