Upload 3 files
Browse files
1EQMnbNPf33xQgguCJcINnytltBVBlcYN
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "bert",
|
| 3 |
+
"alibi_starting_size": 512,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"BertForSequenceClassification"
|
| 6 |
+
],
|
| 7 |
+
"attention_probs_dropout_prob": 0.0,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"gradient_checkpointing": false,
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 768,
|
| 14 |
+
"initializer_range": 0.02,
|
| 15 |
+
"intermediate_size": 3072,
|
| 16 |
+
"layer_norm_eps": 1e-12,
|
| 17 |
+
"max_position_embeddings": 512,
|
| 18 |
+
"num_attention_heads": 12,
|
| 19 |
+
"num_hidden_layers": 12,
|
| 20 |
+
"position_embedding_type": "absolute",
|
| 21 |
+
"problem_type": "single_label_classification",
|
| 22 |
+
"transformers_version": "4.57.6",
|
| 23 |
+
"type_vocab_size": 2,
|
| 24 |
+
"use_cache": true,
|
| 25 |
+
"vocab_size": 4096
|
| 26 |
+
}
|
1NdKd10mnk9hDx8GHalnv8YPNAhSS_MYT
ADDED
|
Binary file (5.78 kB). View file
|
|
|
1d-KKrHiU0v_5NaevSkDUWPhv7W77yt9T
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2022 MosaicML Examples authors
|
| 2 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 3 |
+
|
| 4 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class BertConfig(PretrainedConfig):
|
| 8 |
+
|
| 9 |
+
def __init__(
|
| 10 |
+
self,
|
| 11 |
+
alibi_starting_size: int = 512,
|
| 12 |
+
attention_probs_dropout_prob: float = 0.0,
|
| 13 |
+
**kwargs,
|
| 14 |
+
):
|
| 15 |
+
"""Configuration class for MosaicBert.
|
| 16 |
+
|
| 17 |
+
Args:
|
| 18 |
+
alibi_starting_size (int): Use `alibi_starting_size` to determine how large of an alibi tensor to
|
| 19 |
+
create when initializing the model. You should be able to ignore this parameter in most cases.
|
| 20 |
+
Defaults to 512.
|
| 21 |
+
attention_probs_dropout_prob (float): By default, turn off attention dropout in Mosaic BERT
|
| 22 |
+
(otherwise, Flash Attention will be off by default). Defaults to 0.0.
|
| 23 |
+
"""
|
| 24 |
+
super().__init__(
|
| 25 |
+
attention_probs_dropout_prob=attention_probs_dropout_prob, **kwargs)
|
| 26 |
+
self.alibi_starting_size = alibi_starting_size
|