Subi003 commited on
Commit
4b8c421
·
verified ·
1 Parent(s): 5459f78

Update modeling.py

Browse files
Files changed (1) hide show
  1. modeling.py +6 -6
modeling.py CHANGED
@@ -40,15 +40,15 @@ class RobertaEmoPillars(PreTrainedModel):
40
  num_classes=config.num_labels)
41
  self.post_init() # ensures HF weights init
42
 
43
- def forward(self, input_ids=None, attention_mask=None):
44
- inputs = {"input_ids": input_ids, "attention_mask": attention_mask}
45
- emb = self.encoder(inputs)
46
- logits = self.classifier(emb)
47
- return logits
 
48
 
49
 
50
  # --- Registration for AutoModel ---
51
-
52
  try:
53
  AutoModel.register(AutoConfig, RobertaEmoPillars)
54
  except:
 
40
  num_classes=config.num_labels)
41
  self.post_init() # ensures HF weights init
42
 
43
+ def forward(self, input_ids=None, attention_mask=None, **kwargs):
44
+ inputs = {
45
+ "input_ids": input_ids,
46
+ "attention_mask": attention_mask,
47
+ **kwargs
48
+ }
49
 
50
 
51
  # --- Registration for AutoModel ---
 
52
  try:
53
  AutoModel.register(AutoConfig, RobertaEmoPillars)
54
  except: