Add PyTorch model
Browse files- README.md +60 -0
- all_results.json +14 -0
- config.json +26 -0
- eval_nbest_predictions.json.gz +3 -0
- eval_predictions.json +0 -0
- eval_results.json +9 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +14 -0
- train_results.json +8 -0
- trainer_state.json +199 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- generated_from_trainer
|
5 |
+
datasets:
|
6 |
+
- squad
|
7 |
+
model-index:
|
8 |
+
- name: bert-base-uncased-squad-v1
|
9 |
+
results: []
|
10 |
+
---
|
11 |
+
|
12 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
13 |
+
should probably proofread and complete it, then remove this comment. -->
|
14 |
+
|
15 |
+
# bert-base-uncased-squad-v1
|
16 |
+
|
17 |
+
This model is a fine-tuned version of [bert-base-uncased](https://huggingface.co/bert-base-uncased) on the squad dataset.
|
18 |
+
It was finetuned following the [Transformers Question Answering example](https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering#fine-tuning-bert-on-squad10):
|
19 |
+
|
20 |
+
```
|
21 |
+
python run_qa.py \
|
22 |
+
--model_name_or_path bert-base-uncased \
|
23 |
+
--dataset_name squad \
|
24 |
+
--do_train \
|
25 |
+
--do_eval \
|
26 |
+
--per_device_train_batch_size 12 \
|
27 |
+
--learning_rate 3e-5 \
|
28 |
+
--num_train_epochs 2 \
|
29 |
+
--max_seq_length 384 \
|
30 |
+
--doc_stride 128 \
|
31 |
+
```
|
32 |
+
|
33 |
+
|
34 |
+
### Training hyperparameters
|
35 |
+
|
36 |
+
The following hyperparameters were used during training:
|
37 |
+
- learning_rate: 3e-05
|
38 |
+
- train_batch_size: 12
|
39 |
+
- eval_batch_size: 8
|
40 |
+
- seed: 42
|
41 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
42 |
+
- lr_scheduler_type: linear
|
43 |
+
- num_epochs: 2.0
|
44 |
+
|
45 |
+
### Training results
|
46 |
+
|
47 |
+
```
|
48 |
+
***** eval metrics *****
|
49 |
+
epoch = 2.0
|
50 |
+
eval_exact_match = 81.3434
|
51 |
+
eval_f1 = 88.7002
|
52 |
+
eval_samples = 10784
|
53 |
+
```
|
54 |
+
|
55 |
+
### Framework versions
|
56 |
+
|
57 |
+
- Transformers 4.26.1
|
58 |
+
- Pytorch 1.13.1+cu117
|
59 |
+
- Datasets 2.8.0
|
60 |
+
- Tokenizers 0.13.2
|
all_results.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 2.0,
|
3 |
+
"eval_exact_match": 81.3434247871334,
|
4 |
+
"eval_f1": 88.70015033447665,
|
5 |
+
"eval_runtime": 74.167,
|
6 |
+
"eval_samples": 10784,
|
7 |
+
"eval_samples_per_second": 145.402,
|
8 |
+
"eval_steps_per_second": 18.175,
|
9 |
+
"train_loss": 0.9892611550787075,
|
10 |
+
"train_runtime": 3658.4093,
|
11 |
+
"train_samples": 88524,
|
12 |
+
"train_samples_per_second": 48.395,
|
13 |
+
"train_steps_per_second": 4.033
|
14 |
+
}
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "bert-base-uncased",
|
3 |
+
"architectures": [
|
4 |
+
"BertForQuestionAnswering"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"gradient_checkpointing": false,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 3072,
|
14 |
+
"layer_norm_eps": 1e-12,
|
15 |
+
"max_position_embeddings": 512,
|
16 |
+
"model_type": "bert",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 12,
|
19 |
+
"pad_token_id": 0,
|
20 |
+
"position_embedding_type": "absolute",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.26.1",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30522
|
26 |
+
}
|
eval_nbest_predictions.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5c750938f72f994bb763ffb717bae2eacdf5f0a8077af1504e38be7fc81117ed
|
3 |
+
size 6651720
|
eval_predictions.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
eval_results.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 2.0,
|
3 |
+
"eval_exact_match": 81.3434247871334,
|
4 |
+
"eval_f1": 88.70015033447665,
|
5 |
+
"eval_runtime": 74.167,
|
6 |
+
"eval_samples": 10784,
|
7 |
+
"eval_samples_per_second": 145.402,
|
8 |
+
"eval_steps_per_second": 18.175
|
9 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7d64df54871e3ef926b5649e9faa696f4f1ed2220c28f9f7aa8bd72e71e1d1b7
|
3 |
+
size 435644909
|
special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"do_lower_case": true,
|
4 |
+
"mask_token": "[MASK]",
|
5 |
+
"model_max_length": 512,
|
6 |
+
"name_or_path": "bert-base-uncased",
|
7 |
+
"pad_token": "[PAD]",
|
8 |
+
"sep_token": "[SEP]",
|
9 |
+
"special_tokens_map_file": null,
|
10 |
+
"strip_accents": null,
|
11 |
+
"tokenize_chinese_chars": true,
|
12 |
+
"tokenizer_class": "BertTokenizer",
|
13 |
+
"unk_token": "[UNK]"
|
14 |
+
}
|
train_results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 2.0,
|
3 |
+
"train_loss": 0.9892611550787075,
|
4 |
+
"train_runtime": 3658.4093,
|
5 |
+
"train_samples": 88524,
|
6 |
+
"train_samples_per_second": 48.395,
|
7 |
+
"train_steps_per_second": 4.033
|
8 |
+
}
|
trainer_state.json
ADDED
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": null,
|
3 |
+
"best_model_checkpoint": null,
|
4 |
+
"epoch": 2.0,
|
5 |
+
"global_step": 14754,
|
6 |
+
"is_hyper_param_search": false,
|
7 |
+
"is_local_process_zero": true,
|
8 |
+
"is_world_process_zero": true,
|
9 |
+
"log_history": [
|
10 |
+
{
|
11 |
+
"epoch": 0.07,
|
12 |
+
"learning_rate": 2.8983326555510372e-05,
|
13 |
+
"loss": 2.4547,
|
14 |
+
"step": 500
|
15 |
+
},
|
16 |
+
{
|
17 |
+
"epoch": 0.14,
|
18 |
+
"learning_rate": 2.796665311102074e-05,
|
19 |
+
"loss": 1.4963,
|
20 |
+
"step": 1000
|
21 |
+
},
|
22 |
+
{
|
23 |
+
"epoch": 0.2,
|
24 |
+
"learning_rate": 2.694997966653111e-05,
|
25 |
+
"loss": 1.4012,
|
26 |
+
"step": 1500
|
27 |
+
},
|
28 |
+
{
|
29 |
+
"epoch": 0.27,
|
30 |
+
"learning_rate": 2.593330622204148e-05,
|
31 |
+
"loss": 1.3187,
|
32 |
+
"step": 2000
|
33 |
+
},
|
34 |
+
{
|
35 |
+
"epoch": 0.34,
|
36 |
+
"learning_rate": 2.491663277755185e-05,
|
37 |
+
"loss": 1.249,
|
38 |
+
"step": 2500
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 0.41,
|
42 |
+
"learning_rate": 2.389995933306222e-05,
|
43 |
+
"loss": 1.1969,
|
44 |
+
"step": 3000
|
45 |
+
},
|
46 |
+
{
|
47 |
+
"epoch": 0.47,
|
48 |
+
"learning_rate": 2.288328588857259e-05,
|
49 |
+
"loss": 1.1941,
|
50 |
+
"step": 3500
|
51 |
+
},
|
52 |
+
{
|
53 |
+
"epoch": 0.54,
|
54 |
+
"learning_rate": 2.1866612444082963e-05,
|
55 |
+
"loss": 1.1202,
|
56 |
+
"step": 4000
|
57 |
+
},
|
58 |
+
{
|
59 |
+
"epoch": 0.61,
|
60 |
+
"learning_rate": 2.084993899959333e-05,
|
61 |
+
"loss": 1.0896,
|
62 |
+
"step": 4500
|
63 |
+
},
|
64 |
+
{
|
65 |
+
"epoch": 0.68,
|
66 |
+
"learning_rate": 1.9833265555103702e-05,
|
67 |
+
"loss": 1.0834,
|
68 |
+
"step": 5000
|
69 |
+
},
|
70 |
+
{
|
71 |
+
"epoch": 0.75,
|
72 |
+
"learning_rate": 1.8816592110614073e-05,
|
73 |
+
"loss": 1.1031,
|
74 |
+
"step": 5500
|
75 |
+
},
|
76 |
+
{
|
77 |
+
"epoch": 0.81,
|
78 |
+
"learning_rate": 1.779991866612444e-05,
|
79 |
+
"loss": 1.0656,
|
80 |
+
"step": 6000
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"epoch": 0.88,
|
84 |
+
"learning_rate": 1.6783245221634812e-05,
|
85 |
+
"loss": 1.0266,
|
86 |
+
"step": 6500
|
87 |
+
},
|
88 |
+
{
|
89 |
+
"epoch": 0.95,
|
90 |
+
"learning_rate": 1.576657177714518e-05,
|
91 |
+
"loss": 1.0489,
|
92 |
+
"step": 7000
|
93 |
+
},
|
94 |
+
{
|
95 |
+
"epoch": 1.02,
|
96 |
+
"learning_rate": 1.4749898332655551e-05,
|
97 |
+
"loss": 0.944,
|
98 |
+
"step": 7500
|
99 |
+
},
|
100 |
+
{
|
101 |
+
"epoch": 1.08,
|
102 |
+
"learning_rate": 1.373322488816592e-05,
|
103 |
+
"loss": 0.7275,
|
104 |
+
"step": 8000
|
105 |
+
},
|
106 |
+
{
|
107 |
+
"epoch": 1.15,
|
108 |
+
"learning_rate": 1.271655144367629e-05,
|
109 |
+
"loss": 0.7439,
|
110 |
+
"step": 8500
|
111 |
+
},
|
112 |
+
{
|
113 |
+
"epoch": 1.22,
|
114 |
+
"learning_rate": 1.1699877999186661e-05,
|
115 |
+
"loss": 0.7352,
|
116 |
+
"step": 9000
|
117 |
+
},
|
118 |
+
{
|
119 |
+
"epoch": 1.29,
|
120 |
+
"learning_rate": 1.0683204554697033e-05,
|
121 |
+
"loss": 0.693,
|
122 |
+
"step": 9500
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"epoch": 1.36,
|
126 |
+
"learning_rate": 9.666531110207402e-06,
|
127 |
+
"loss": 0.736,
|
128 |
+
"step": 10000
|
129 |
+
},
|
130 |
+
{
|
131 |
+
"epoch": 1.42,
|
132 |
+
"learning_rate": 8.649857665717772e-06,
|
133 |
+
"loss": 0.7238,
|
134 |
+
"step": 10500
|
135 |
+
},
|
136 |
+
{
|
137 |
+
"epoch": 1.49,
|
138 |
+
"learning_rate": 7.633184221228141e-06,
|
139 |
+
"loss": 0.7266,
|
140 |
+
"step": 11000
|
141 |
+
},
|
142 |
+
{
|
143 |
+
"epoch": 1.56,
|
144 |
+
"learning_rate": 6.616510776738511e-06,
|
145 |
+
"loss": 0.7112,
|
146 |
+
"step": 11500
|
147 |
+
},
|
148 |
+
{
|
149 |
+
"epoch": 1.63,
|
150 |
+
"learning_rate": 5.5998373322488825e-06,
|
151 |
+
"loss": 0.7348,
|
152 |
+
"step": 12000
|
153 |
+
},
|
154 |
+
{
|
155 |
+
"epoch": 1.69,
|
156 |
+
"learning_rate": 4.583163887759252e-06,
|
157 |
+
"loss": 0.6808,
|
158 |
+
"step": 12500
|
159 |
+
},
|
160 |
+
{
|
161 |
+
"epoch": 1.76,
|
162 |
+
"learning_rate": 3.566490443269622e-06,
|
163 |
+
"loss": 0.6928,
|
164 |
+
"step": 13000
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"epoch": 1.83,
|
168 |
+
"learning_rate": 2.549816998779992e-06,
|
169 |
+
"loss": 0.7016,
|
170 |
+
"step": 13500
|
171 |
+
},
|
172 |
+
{
|
173 |
+
"epoch": 1.9,
|
174 |
+
"learning_rate": 1.533143554290362e-06,
|
175 |
+
"loss": 0.719,
|
176 |
+
"step": 14000
|
177 |
+
},
|
178 |
+
{
|
179 |
+
"epoch": 1.97,
|
180 |
+
"learning_rate": 5.164701098007319e-07,
|
181 |
+
"loss": 0.7163,
|
182 |
+
"step": 14500
|
183 |
+
},
|
184 |
+
{
|
185 |
+
"epoch": 2.0,
|
186 |
+
"step": 14754,
|
187 |
+
"total_flos": 3.4696551139946496e+16,
|
188 |
+
"train_loss": 0.9892611550787075,
|
189 |
+
"train_runtime": 3658.4093,
|
190 |
+
"train_samples_per_second": 48.395,
|
191 |
+
"train_steps_per_second": 4.033
|
192 |
+
}
|
193 |
+
],
|
194 |
+
"max_steps": 14754,
|
195 |
+
"num_train_epochs": 2,
|
196 |
+
"total_flos": 3.4696551139946496e+16,
|
197 |
+
"trial_name": null,
|
198 |
+
"trial_params": null
|
199 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:26a2eebb14569b751c64a2d5f4f110cbda50a97f9546e04a6896423d5e287a55
|
3 |
+
size 3515
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|