CCCCyx commited on
Commit
23671ca
·
verified ·
1 Parent(s): 880e8c2

fix _tied_weights_keys format

Browse files
Files changed (1) hide show
  1. modeling_moss_vl.py +5 -1
modeling_moss_vl.py CHANGED
@@ -2152,7 +2152,11 @@ class MossVLModel(MossVLPreTrainedModel):
2152
  """
2153
  )
2154
  class MossVLForConditionalGeneration(MossVLPreTrainedModel, GenerationMixin):
2155
- _tied_weights_keys = ["lm_head.weight"]
 
 
 
 
2156
  config: MossVLConfig
2157
  _checkpoint_conversion_mapping = {}
2158
  accepts_loss_kwargs = False
 
2152
  """
2153
  )
2154
  class MossVLForConditionalGeneration(MossVLPreTrainedModel, GenerationMixin):
2155
+ # transformers 5.x expects a dict[target, source]; MossVL does not tie
2156
+ # lm_head to the embeddings (config.tie_word_embeddings is False), so the
2157
+ # mapping is empty. The legacy list format ["lm_head.weight"] breaks
2158
+ # save_pretrained in transformers>=5.
2159
+ _tied_weights_keys: dict[str, str] = {}
2160
  config: MossVLConfig
2161
  _checkpoint_conversion_mapping = {}
2162
  accepts_loss_kwargs = False