Update model.py
#1
by
KoichiYasuoka
- opened
model.py
CHANGED
@@ -436,7 +436,6 @@ class NeoBERTForTokenClassification(NeoBERTPreTrainedModel):
|
|
436 |
|
437 |
self.model = NeoBERT(config)
|
438 |
|
439 |
-
self.dense = nn.Linear(self.config.hidden_size, self.config.hidden_size)
|
440 |
self.dropout = nn.Dropout(self.classifier_dropout)
|
441 |
self.classifier = nn.Linear(self.config.hidden_size, self.num_labels)
|
442 |
|
@@ -470,12 +469,7 @@ class NeoBERTForTokenClassification(NeoBERTPreTrainedModel):
|
|
470 |
output_attentions,
|
471 |
)
|
472 |
x = output.last_hidden_state
|
473 |
-
|
474 |
-
x = self.dropout(x)
|
475 |
-
x = self.dense(x)
|
476 |
-
x = torch.tanh(x)
|
477 |
x = self.dropout(x)
|
478 |
-
|
479 |
logits = self.classifier(x)
|
480 |
|
481 |
loss = None
|
|
|
436 |
|
437 |
self.model = NeoBERT(config)
|
438 |
|
|
|
439 |
self.dropout = nn.Dropout(self.classifier_dropout)
|
440 |
self.classifier = nn.Linear(self.config.hidden_size, self.num_labels)
|
441 |
|
|
|
469 |
output_attentions,
|
470 |
)
|
471 |
x = output.last_hidden_state
|
|
|
|
|
|
|
|
|
472 |
x = self.dropout(x)
|
|
|
473 |
logits = self.classifier(x)
|
474 |
|
475 |
loss = None
|