Spaces:
Runtime error
Runtime error
Update model.py
Browse files
model.py
CHANGED
|
@@ -31,7 +31,7 @@ class CommentMTLModel(nn.Module):
|
|
| 31 |
# Takes BERT's pooled output and maps it to toxicity logits (multi-label)
|
| 32 |
self.toxicity_classifier = nn.Linear(self.bert.config.hidden_size, num_toxicity_labels)
|
| 33 |
|
| 34 |
-
def forward(self, input_ids, attention_mask):
|
| 35 |
"""
|
| 36 |
Forward pass of the model.
|
| 37 |
|
|
@@ -48,6 +48,7 @@ class CommentMTLModel(nn.Module):
|
|
| 48 |
outputs = self.bert(
|
| 49 |
input_ids=input_ids,
|
| 50 |
attention_mask=attention_mask
|
|
|
|
| 51 |
)
|
| 52 |
|
| 53 |
# Get the pooled output
|
|
|
|
| 31 |
# Takes BERT's pooled output and maps it to toxicity logits (multi-label)
|
| 32 |
self.toxicity_classifier = nn.Linear(self.bert.config.hidden_size, num_toxicity_labels)
|
| 33 |
|
| 34 |
+
def forward(self, input_ids, attention_mask, token_type_ids=None):
|
| 35 |
"""
|
| 36 |
Forward pass of the model.
|
| 37 |
|
|
|
|
| 48 |
outputs = self.bert(
|
| 49 |
input_ids=input_ids,
|
| 50 |
attention_mask=attention_mask
|
| 51 |
+
token_type_ids=token_type_ids
|
| 52 |
)
|
| 53 |
|
| 54 |
# Get the pooled output
|