joaogante HF staff commited on
Commit
60de8dd
1 Parent(s): 9e037f6

add prepare_inputs_for_generation

Browse files
Files changed (1) hide show
  1. modeling.py +5 -0
modeling.py CHANGED
@@ -11,3 +11,8 @@ class NewModelForCausalLM(BertModel):
11
  def __init__(self, config):
12
  super().__init__(config)
13
  self.last_layer = torch.nn.Linear(config.hidden_size, config.new_hidden_size)
 
 
 
 
 
 
11
  def __init__(self, config):
12
  super().__init__(config)
13
  self.last_layer = torch.nn.Linear(config.hidden_size, config.new_hidden_size)
14
+
15
+ # prior to v4.45, overwriting `prepare_inputs_for_generation` was a hard requirement for a model to be
16
+ # `generate`-compatible
17
+ def prepare_inputs_for_generation(self):
18
+ pass