add model
Browse files- config.json +29 -0
- custom_model.py +13 -0
- pytorch_model.bin +3 -0
config.json
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "models/",
|
3 |
+
"architectures": [
|
4 |
+
"Model"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"auto_map": {
|
8 |
+
"AutoModel": "custom_model.Model"
|
9 |
+
},
|
10 |
+
"classifier_dropout": null,
|
11 |
+
"gradient_checkpointing": false,
|
12 |
+
"hidden_act": "gelu",
|
13 |
+
"hidden_dropout_prob": 0.1,
|
14 |
+
"hidden_size": 768,
|
15 |
+
"initializer_range": 0.02,
|
16 |
+
"intermediate_size": 3072,
|
17 |
+
"layer_norm_eps": 1e-12,
|
18 |
+
"max_position_embeddings": 512,
|
19 |
+
"model_type": "bert",
|
20 |
+
"num_attention_heads": 12,
|
21 |
+
"num_hidden_layers": 12,
|
22 |
+
"pad_token_id": 0,
|
23 |
+
"position_embedding_type": "absolute",
|
24 |
+
"torch_dtype": "float32",
|
25 |
+
"transformers_version": "4.17.0",
|
26 |
+
"type_vocab_size": 2,
|
27 |
+
"use_cache": true,
|
28 |
+
"vocab_size": 30522
|
29 |
+
}
|
custom_model.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import PreTrainedModel, BertConfig, AutoModel
|
2 |
+
|
3 |
+
|
4 |
+
class Model(PreTrainedModel):
|
5 |
+
config_class = BertConfig
|
6 |
+
|
7 |
+
def __init__(self, config):
|
8 |
+
super().__init__(config)
|
9 |
+
self.model = AutoModel.from_pretrained("bert-base-uncased")
|
10 |
+
|
11 |
+
def forward(self, **inputs):
|
12 |
+
outs = self.model(inputs)
|
13 |
+
return outs
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:acb7d58fcc3ac1f1c8b3eb11bf692ab5ead2c255a429572a4c450e07cf6d4a14
|
3 |
+
size 438010993
|