Upload folder using huggingface_hub
Browse files- modeling_havelock.py +2 -2
modeling_havelock.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
import torch
|
| 4 |
import torch.nn as nn
|
| 5 |
-
from transformers import
|
| 6 |
|
| 7 |
|
| 8 |
class HavelockTokenClassifier(BertPreTrainedModel):
|
|
@@ -17,7 +17,7 @@ class HavelockTokenClassifier(BertPreTrainedModel):
|
|
| 17 |
def __init__(self, config):
|
| 18 |
super().__init__(config)
|
| 19 |
self.num_types = config.num_types
|
| 20 |
-
self.bert =
|
| 21 |
self.dropout = nn.Dropout(config.hidden_dropout_prob)
|
| 22 |
self.classifier = nn.Linear(config.hidden_size, config.num_types * 3)
|
| 23 |
self.post_init()
|
|
|
|
| 2 |
|
| 3 |
import torch
|
| 4 |
import torch.nn as nn
|
| 5 |
+
from transformers import BertModel, BertPreTrainedModel
|
| 6 |
|
| 7 |
|
| 8 |
class HavelockTokenClassifier(BertPreTrainedModel):
|
|
|
|
| 17 |
def __init__(self, config):
|
| 18 |
super().__init__(config)
|
| 19 |
self.num_types = config.num_types
|
| 20 |
+
self.bert = BertModel(config, add_pooling_layer=False)
|
| 21 |
self.dropout = nn.Dropout(config.hidden_dropout_prob)
|
| 22 |
self.classifier = nn.Linear(config.hidden_size, config.num_types * 3)
|
| 23 |
self.post_init()
|