Fill-Mask
Transformers
PyTorch
Norwegian
Norwegian Bokmål
Norwegian Nynorsk
BERT
NorBERT
Norwegian
encoder
custom_code
Instructions to use ltg/norbert3-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ltg/norbert3-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="ltg/norbert3-base", trust_remote_code=True)# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("ltg/norbert3-base", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_norbert.py
Browse files- modeling_norbert.py +5 -2
modeling_norbert.py
CHANGED
|
@@ -440,7 +440,10 @@ class NorbertForSequenceClassification(NorbertModel):
|
|
| 440 |
self.head = Classifier(config, self.num_labels)
|
| 441 |
|
| 442 |
def post_init(self):
|
| 443 |
-
self.head.
|
|
|
|
|
|
|
|
|
|
| 444 |
|
| 445 |
def forward(
|
| 446 |
self,
|
|
@@ -509,7 +512,7 @@ class NorbertForTokenClassification(NorbertModel):
|
|
| 509 |
self.head = Classifier(config, self.num_labels)
|
| 510 |
|
| 511 |
def post_init(self):
|
| 512 |
-
self.head.
|
| 513 |
|
| 514 |
def forward(
|
| 515 |
self,
|
|
|
|
| 440 |
self.head = Classifier(config, self.num_labels)
|
| 441 |
|
| 442 |
def post_init(self):
|
| 443 |
+
self.head._init_weights()
|
| 444 |
+
|
| 445 |
+
def _init_weights(self):
|
| 446 |
+
self.head._init_weights()
|
| 447 |
|
| 448 |
def forward(
|
| 449 |
self,
|
|
|
|
| 512 |
self.head = Classifier(config, self.num_labels)
|
| 513 |
|
| 514 |
def post_init(self):
|
| 515 |
+
self.head._init_weights()
|
| 516 |
|
| 517 |
def forward(
|
| 518 |
self,
|