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 +1 -1
modeling_norbert.py
CHANGED
|
@@ -142,7 +142,7 @@ class Attention(nn.Module):
|
|
| 142 |
- torch.arange(config.max_position_embeddings, dtype=torch.long).unsqueeze(0)
|
| 143 |
position_indices = self.make_log_bucket_position(position_indices, config.position_bucket_size, config.max_position_embeddings)
|
| 144 |
position_indices = config.position_bucket_size - 1 + position_indices
|
| 145 |
-
self.register_buffer("position_indices", position_indices, persistent=
|
| 146 |
|
| 147 |
self.dropout = nn.Dropout(config.attention_probs_dropout_prob)
|
| 148 |
self.scale = 1.0 / math.sqrt(3 * self.head_size)
|
|
|
|
| 142 |
- torch.arange(config.max_position_embeddings, dtype=torch.long).unsqueeze(0)
|
| 143 |
position_indices = self.make_log_bucket_position(position_indices, config.position_bucket_size, config.max_position_embeddings)
|
| 144 |
position_indices = config.position_bucket_size - 1 + position_indices
|
| 145 |
+
self.register_buffer("position_indices", position_indices, persistent=False)
|
| 146 |
|
| 147 |
self.dropout = nn.Dropout(config.attention_probs_dropout_prob)
|
| 148 |
self.scale = 1.0 / math.sqrt(3 * self.head_size)
|