Spaces:
Runtime error
Runtime error
Update bigbird_anayasa_classifier.py
Browse files
bigbird_anayasa_classifier.py
CHANGED
|
@@ -5,12 +5,14 @@ from transformers import BigBirdModel
|
|
| 5 |
|
| 6 |
class BigBirdClassifier(nn.Module):
|
| 7 |
|
| 8 |
-
def __init__(self,
|
| 9 |
super(BigBirdClassifier, self).__init__()
|
| 10 |
|
| 11 |
self.bert = BigBirdModel.from_pretrained("FiratIsmailoglu/bigbird-turkish-pretrained", attention_type="block_sparse")
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
self.dropout = nn.Dropout(
|
| 14 |
self.fc1 = nn.Linear(hidden_size, 256)
|
| 15 |
self.norm1 = nn.LayerNorm(256)
|
| 16 |
self.relu = nn.ReLU()
|
|
|
|
| 5 |
|
| 6 |
class BigBirdClassifier(nn.Module):
|
| 7 |
|
| 8 |
+
def __init__(self, config):
|
| 9 |
super(BigBirdClassifier, self).__init__()
|
| 10 |
|
| 11 |
self.bert = BigBirdModel.from_pretrained("FiratIsmailoglu/bigbird-turkish-pretrained", attention_type="block_sparse")
|
| 12 |
+
hidden_size = config.hidden_size # e.g. 768
|
| 13 |
+
num_labels = config.num_labels
|
| 14 |
|
| 15 |
+
self.dropout = nn.Dropout(0.1)
|
| 16 |
self.fc1 = nn.Linear(hidden_size, 256)
|
| 17 |
self.norm1 = nn.LayerNorm(256)
|
| 18 |
self.relu = nn.ReLU()
|