Update modeling.py
Browse files- 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 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
| 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:
|