Instructions to use magicslabnu/OutEffHop_bert_base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use magicslabnu/OutEffHop_bert_base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="magicslabnu/OutEffHop_bert_base", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("magicslabnu/OutEffHop_bert_base", trust_remote_code=True) model = AutoModelForMaskedLM.from_pretrained("magicslabnu/OutEffHop_bert_base", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Update modeling_bert.py
Browse files- modeling_bert.py +1 -1
modeling_bert.py
CHANGED
|
@@ -387,7 +387,7 @@ class BertSelfAttention(nn.Module):
|
|
| 387 |
# Normalize the attention scores to probabilities.
|
| 388 |
#attention_probs = nn.functional.softmax(attention_scores, dim=-1)
|
| 389 |
attention_probs = softmax_1(attention_scores, dim=-1)
|
| 390 |
-
|
| 391 |
|
| 392 |
# This is actually dropping out entire tokens to attend to, which might
|
| 393 |
# seem a bit unusual, but is taken from the original Transformer paper.
|
|
|
|
| 387 |
# Normalize the attention scores to probabilities.
|
| 388 |
#attention_probs = nn.functional.softmax(attention_scores, dim=-1)
|
| 389 |
attention_probs = softmax_1(attention_scores, dim=-1)
|
| 390 |
+
|
| 391 |
|
| 392 |
# This is actually dropping out entire tokens to attend to, which might
|
| 393 |
# seem a bit unusual, but is taken from the original Transformer paper.
|