yangwang825
commited on
Commit
·
f1e1b74
1
Parent(s):
2912b99
Upload config
Browse files- config.json +23 -0
- configuration_bert.py +44 -0
config.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"attention_probs_dropout_prob": 0.1,
|
3 |
+
"auto_map": {
|
4 |
+
"AutoConfig": "configuration_bert.BertConfig"
|
5 |
+
},
|
6 |
+
"classifier_dropout": null,
|
7 |
+
"hidden_act": "gelu",
|
8 |
+
"hidden_dropout_prob": 0.1,
|
9 |
+
"hidden_size": 768,
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"intermediate_size": 3072,
|
12 |
+
"layer_norm_eps": 1e-12,
|
13 |
+
"max_position_embeddings": 512,
|
14 |
+
"model_type": "bert",
|
15 |
+
"num_attention_heads": 12,
|
16 |
+
"num_hidden_layers": 12,
|
17 |
+
"pad_token_id": 0,
|
18 |
+
"position_embedding_type": "absolute",
|
19 |
+
"transformers_version": "4.33.3",
|
20 |
+
"type_vocab_size": 2,
|
21 |
+
"use_cache": true,
|
22 |
+
"vocab_size": 30522
|
23 |
+
}
|
configuration_bert.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import PretrainedConfig
|
2 |
+
|
3 |
+
|
4 |
+
class BertConfig(PretrainedConfig):
|
5 |
+
|
6 |
+
model_type = "bert"
|
7 |
+
|
8 |
+
def __init__(
|
9 |
+
self,
|
10 |
+
vocab_size=30522,
|
11 |
+
hidden_size=768,
|
12 |
+
num_hidden_layers=12,
|
13 |
+
num_attention_heads=12,
|
14 |
+
intermediate_size=3072,
|
15 |
+
hidden_act="gelu",
|
16 |
+
hidden_dropout_prob=0.1,
|
17 |
+
attention_probs_dropout_prob=0.1,
|
18 |
+
max_position_embeddings=512,
|
19 |
+
type_vocab_size=2,
|
20 |
+
initializer_range=0.02,
|
21 |
+
layer_norm_eps=1e-12,
|
22 |
+
pad_token_id=0,
|
23 |
+
position_embedding_type="absolute",
|
24 |
+
use_cache=True,
|
25 |
+
classifier_dropout=None,
|
26 |
+
**kwargs,
|
27 |
+
):
|
28 |
+
super().__init__(pad_token_id=pad_token_id, **kwargs)
|
29 |
+
|
30 |
+
self.vocab_size = vocab_size
|
31 |
+
self.hidden_size = hidden_size
|
32 |
+
self.num_hidden_layers = num_hidden_layers
|
33 |
+
self.num_attention_heads = num_attention_heads
|
34 |
+
self.hidden_act = hidden_act
|
35 |
+
self.intermediate_size = intermediate_size
|
36 |
+
self.hidden_dropout_prob = hidden_dropout_prob
|
37 |
+
self.attention_probs_dropout_prob = attention_probs_dropout_prob
|
38 |
+
self.max_position_embeddings = max_position_embeddings
|
39 |
+
self.type_vocab_size = type_vocab_size
|
40 |
+
self.initializer_range = initializer_range
|
41 |
+
self.layer_norm_eps = layer_norm_eps
|
42 |
+
self.position_embedding_type = position_embedding_type
|
43 |
+
self.use_cache = use_cache
|
44 |
+
self.classifier_dropout = classifier_dropout
|