AlgoDriveAI commited on
Commit
4b3de72
·
verified ·
1 Parent(s): 4461ac5

Transformers 5 compatibility: _tied_weights_keys as a {target: source} dict

Browse files
Files changed (1) hide show
  1. modeling_inferno.py +1 -1
modeling_inferno.py CHANGED
@@ -99,7 +99,7 @@ class Block(nn.Module):
99
  class InfernoForCausalLM(PreTrainedModel, GenerationMixin):
100
  config_class = InfernoConfig
101
  base_model_prefix = "model"
102
- _tied_weights_keys = ["lm_head.weight"]
103
  _no_split_modules = ["Block"]
104
 
105
  def __init__(self, config):
 
99
  class InfernoForCausalLM(PreTrainedModel, GenerationMixin):
100
  config_class = InfernoConfig
101
  base_model_prefix = "model"
102
+ _tied_weights_keys = {"lm_head.weight": "embed.weight"} # {target: source}; works on Transformers 4 and 5
103
  _no_split_modules = ["Block"]
104
 
105
  def __init__(self, config):