joaogante HF staff commited on
Commit
9e037f6
1 Parent(s): 29ac323

add notes:

Browse files
Files changed (1) hide show
  1. modeling.py +4 -2
modeling.py CHANGED
@@ -1,9 +1,11 @@
1
  import torch
2
- from transformers import BertLMHeadModel
3
 
4
  from .configuration import NewModelConfig
5
 
6
- class NewModelForCausalLM(BertLMHeadModel):
 
 
7
  config_class = NewModelConfig
8
 
9
  def __init__(self, config):
 
1
  import torch
2
+ from transformers import BertModel
3
 
4
  from .configuration import NewModelConfig
5
 
6
+ # It doesn't inherit from a generate-compatible class, so it would throw an error when calling `generate` if
7
+ # `transformers` wouldn't automatically patch inheritance
8
+ class NewModelForCausalLM(BertModel):
9
  config_class = NewModelConfig
10
 
11
  def __init__(self, config):