ThreeBlessings commited on
Commit
2a4326f
·
1 Parent(s): cce6458

Added application file

Browse files
demo.py ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import torch
3
+ import transformers
4
+
5
+ model: transformers.AlbertForQuestionAnswering = (
6
+ transformers.AlbertForQuestionAnswering.from_pretrained("./model")
7
+ )
8
+ tokenizer: transformers.AlbertTokenizer = (
9
+ transformers.AlbertTokenizerFast.from_pretrained("./model")
10
+ )
11
+
12
+ n_best_size = 20
13
+ max_answer_length = 30
14
+ null_score_diff_threshold = 0.0
15
+ max_length = 384
16
+ stride = 128
17
+
18
+ article = """Check out the project repository at [GitHub]().
19
+
20
+ Training logs can be found at [ClearML](https://app.clear.ml/projects/cd2f4008afa34a68bd085588fe8f44e1/experiments/a971b54e499a4dbe8b90faf9b6969608/output/execution) (you must be registered to access the log).
21
+ """
22
+
23
+ example_context = 'The Normans (Norman: Nourmands; French: Normands; Latin: Normanni) were the people who in the 10th and 11th centuries gave their name to Normandy, a region in France. They were descended from Norse ("Norman" comes from "Norseman") raiders and pirates from Denmark, Iceland and Norway who, under their leader Rollo, agreed to swear fealty to King Charles III of West Francia. Through generations of assimilation and mixing with the native Frankish and Roman-Gaulish populations, their descendants would gradually merge with the Carolingian-based cultures of West Francia. The distinct cultural and ethnic identity of the Normans emerged initially in the first half of the 10th century, and it continued to evolve over the succeeding centuries.'
24
+ example_question = "In what country is Normandy located?"
25
+
26
+
27
+ def predict(context: str, question: str) -> str:
28
+ model_inputs = tokenizer(
29
+ question,
30
+ context,
31
+ max_length=max_length,
32
+ truncation="only_second",
33
+ stride=stride,
34
+ return_overflowing_tokens=True,
35
+ return_offsets_mapping=True,
36
+ padding="max_length",
37
+ return_tensors="pt",
38
+ )
39
+ offset_mapping = model_inputs.pop("offset_mapping")
40
+ model_inputs.pop("overflow_to_sample_mapping")
41
+ output = model(**model_inputs)
42
+ prelim_predictions = []
43
+ min_null_prediction = None
44
+ null_score = 0.0
45
+
46
+ for i, offest in enumerate(offset_mapping):
47
+ start_logits = output.start_logits[i]
48
+ end_logits = output.end_logits[i]
49
+
50
+ # Update minimum null prediction.
51
+ feature_null_score = start_logits[0] + end_logits[0]
52
+ min_null_prediction = {
53
+ "offsets": (0, 0),
54
+ "score": feature_null_score,
55
+ "start_logit": start_logits[0],
56
+ "end_logit": end_logits[0],
57
+ }
58
+
59
+ # Go through all possibilities for the `n_best_size` greater start and end logits.
60
+ start_indexes = torch.argsort(start_logits, descending=True)[
61
+ :n_best_size
62
+ ].tolist()
63
+ end_indexes = torch.argsort(end_logits, descending=True)[:n_best_size].tolist()
64
+ for start_index in start_indexes:
65
+ for end_index in end_indexes:
66
+ # Don't consider out-of-scope answers, either because the indices are out of bounds or correspond
67
+ # to part of the input_ids that are not in the context.
68
+ if (
69
+ start_index >= len(offest)
70
+ or end_index >= len(offest)
71
+ or offest[start_index] is None
72
+ or len(offest[start_index]) < 2
73
+ or offest[end_index] is None
74
+ or len(offest[end_index]) < 2
75
+ ):
76
+ continue
77
+ # Don't consider answers with a length that is either < 0 or > max_answer_length.
78
+ if (
79
+ end_index < start_index
80
+ or end_index - start_index + 1 > max_answer_length
81
+ ):
82
+ continue
83
+
84
+ prelim_predictions.append(
85
+ {
86
+ "offsets": (
87
+ offest[start_index][0],
88
+ offest[end_index][1],
89
+ ),
90
+ "score": start_logits[start_index] + end_logits[end_index],
91
+ "start_logit": start_logits[start_index],
92
+ "end_logit": end_logits[end_index],
93
+ }
94
+ )
95
+ if min_null_prediction is not None:
96
+ prelim_predictions.append(min_null_prediction)
97
+ null_score = min_null_prediction["score"]
98
+
99
+ # Only keep the best `n_best_size` predictions.
100
+ predictions = sorted(prelim_predictions, key=lambda x: x["score"], reverse=True)[
101
+ :n_best_size
102
+ ]
103
+
104
+ if min_null_prediction is not None and not any(
105
+ p["offsets"] == (0, 0) for p in predictions
106
+ ):
107
+ predictions.append(min_null_prediction)
108
+
109
+ # Use the offsets to gather the answer text in the original context.
110
+ for pred in predictions:
111
+ offsets = pred.pop("offsets")
112
+ pred["text"] = context[offsets[0] : offsets[1]]
113
+
114
+ # In the very rare edge case we have not a single non-null prediction, we create a fake prediction to avoid
115
+ # failure.
116
+ if len(predictions) == 0 or (
117
+ len(predictions) == 1 and predictions[0]["text"] == ""
118
+ ):
119
+ predictions.insert(
120
+ 0, {"text": "empty", "start_logit": 0.0, "end_logit": 0.0, "score": 0.0}
121
+ )
122
+
123
+ probs = torch.nn.functional.softmax(
124
+ torch.tensor([pred.pop("score") for pred in predictions]), dim=0
125
+ )
126
+
127
+ # Include the probabilities in our predictions.
128
+ for prob, pred in zip(probs, predictions):
129
+ pred["probability"] = prob
130
+
131
+ # Pick the best prediction.
132
+ i = 0
133
+ while predictions[i]["text"] == "":
134
+ i += 1
135
+ best_non_null_pred = predictions[i]
136
+
137
+ # Then we compare to the null prediction using the threshold.
138
+ score_diff = (
139
+ null_score - best_non_null_pred["start_logit"] - best_non_null_pred["end_logit"]
140
+ )
141
+ return (
142
+ "The context doesn't contain answer to this question."
143
+ if score_diff > null_score_diff_threshold
144
+ else best_non_null_pred["text"]
145
+ )
146
+
147
+
148
+ if __name__ == "__main__":
149
+ demo = gr.Interface(
150
+ fn=predict,
151
+ inputs=[
152
+ gr.TextArea(label="Context", value=example_context),
153
+ gr.Textbox(label="Question", value=example_question),
154
+ ],
155
+ outputs=gr.Textbox(label="Answer"),
156
+ title="EureQA: Extractive Question Answering model",
157
+ description="""EureQA is an extractive question answering model based on the [ALBERT Base v2](https://huggingface.co/albert/albert-base-v2)
158
+ architecture and finetuned on [SQuAD 2.0](https://huggingface.co/datasets/rajpurkar/squad_v2) dataset.""",
159
+ article=article,
160
+ )
161
+ demo.launch(share=True)
model/config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "albert/albert-base-v2",
3
+ "architectures": [
4
+ "AlbertForQuestionAnswering"
5
+ ],
6
+ "attention_probs_dropout_prob": 0,
7
+ "bos_token_id": 2,
8
+ "classifier_dropout_prob": 0.1,
9
+ "down_scale_factor": 1,
10
+ "embedding_size": 128,
11
+ "eos_token_id": 3,
12
+ "gap_size": 0,
13
+ "hidden_act": "gelu_new",
14
+ "hidden_dropout_prob": 0,
15
+ "hidden_size": 768,
16
+ "initializer_range": 0.02,
17
+ "inner_group_num": 1,
18
+ "intermediate_size": 3072,
19
+ "layer_norm_eps": 1e-12,
20
+ "max_position_embeddings": 512,
21
+ "model_type": "albert",
22
+ "net_structure_type": 0,
23
+ "num_attention_heads": 12,
24
+ "num_hidden_groups": 1,
25
+ "num_hidden_layers": 12,
26
+ "num_memory_blocks": 0,
27
+ "pad_token_id": 0,
28
+ "position_embedding_type": "absolute",
29
+ "torch_dtype": "float32",
30
+ "transformers_version": "4.44.2",
31
+ "type_vocab_size": 2,
32
+ "vocab_size": 30000
33
+ }
model/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99fbd6be3b4f27957bdf0a28537443b3d8dd66b382f454e4ac77ec8657e34c1d
3
+ size 44381360
model/special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "[CLS]",
3
+ "cls_token": "[CLS]",
4
+ "eos_token": "[SEP]",
5
+ "mask_token": {
6
+ "content": "[MASK]",
7
+ "lstrip": true,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "pad_token": "<pad>",
13
+ "sep_token": "[SEP]",
14
+ "unk_token": "<unk>"
15
+ }
model/spiece.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fefb02b667a6c5c2fe27602d28e5fb3428f66ab89c7d6f388e7c8d44a02d0336
3
+ size 760289
model/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
model/tokenizer_config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<pad>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<unk>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "[MASK]",
37
+ "lstrip": true,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "[CLS]",
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "[CLS]",
47
+ "do_lower_case": true,
48
+ "eos_token": "[SEP]",
49
+ "keep_accents": false,
50
+ "mask_token": "[MASK]",
51
+ "model_max_length": 512,
52
+ "pad_token": "<pad>",
53
+ "remove_space": true,
54
+ "sep_token": "[SEP]",
55
+ "tokenizer_class": "AlbertTokenizer",
56
+ "unk_token": "<unk>"
57
+ }
model/trainer_state.json ADDED
@@ -0,0 +1,332 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 2.0,
5
+ "eval_steps": 2000,
6
+ "global_step": 21994,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0,
13
+ "eval_HasAns_exact": 0.06747638326585695,
14
+ "eval_HasAns_f1": 7.18502154989456,
15
+ "eval_HasAns_total": 5928,
16
+ "eval_NoAns_exact": 0.0336417157275021,
17
+ "eval_NoAns_f1": 0.0336417157275021,
18
+ "eval_NoAns_total": 5945,
19
+ "eval_best_exact": 50.07159100480081,
20
+ "eval_best_exact_thresh": 0.0,
21
+ "eval_best_f1": 50.075846569172874,
22
+ "eval_best_f1_thresh": 0.0,
23
+ "eval_exact": 0.050534826918217805,
24
+ "eval_f1": 3.6042118881306284,
25
+ "eval_runtime": -14.2699,
26
+ "eval_samples_per_second": -852.912,
27
+ "eval_steps_per_second": -13.385,
28
+ "eval_total": 11873,
29
+ "step": 0
30
+ },
31
+ {
32
+ "epoch": 0.18186778212239701,
33
+ "grad_norm": 40.6475715637207,
34
+ "learning_rate": 2.7271983268164044e-05,
35
+ "loss": 1.4132,
36
+ "step": 2000
37
+ },
38
+ {
39
+ "epoch": 0.18186778212239701,
40
+ "eval_HasAns_exact": 67.25708502024291,
41
+ "eval_HasAns_f1": 74.98296116605809,
42
+ "eval_HasAns_total": 5928,
43
+ "eval_NoAns_exact": 70.81581160639193,
44
+ "eval_NoAns_f1": 70.81581160639193,
45
+ "eval_NoAns_total": 5945,
46
+ "eval_best_exact": 69.03899604143855,
47
+ "eval_best_exact_thresh": 0.0,
48
+ "eval_best_f1": 72.89640308198375,
49
+ "eval_best_f1_thresh": 0.0,
50
+ "eval_exact": 69.03899604143855,
51
+ "eval_f1": 72.89640308198369,
52
+ "eval_runtime": 136.0827,
53
+ "eval_samples_per_second": 89.438,
54
+ "eval_steps_per_second": 1.404,
55
+ "eval_total": 11873,
56
+ "step": 2000
57
+ },
58
+ {
59
+ "epoch": 0.36373556424479403,
60
+ "grad_norm": 41.061927795410156,
61
+ "learning_rate": 2.4543966536328087e-05,
62
+ "loss": 1.2638,
63
+ "step": 4000
64
+ },
65
+ {
66
+ "epoch": 0.36373556424479403,
67
+ "eval_HasAns_exact": 73.59986504723346,
68
+ "eval_HasAns_f1": 81.00757791997825,
69
+ "eval_HasAns_total": 5928,
70
+ "eval_NoAns_exact": 65.78637510513036,
71
+ "eval_NoAns_f1": 65.78637510513036,
72
+ "eval_NoAns_total": 5945,
73
+ "eval_best_exact": 69.68752632022235,
74
+ "eval_best_exact_thresh": 0.0,
75
+ "eval_best_f1": 73.38607950051664,
76
+ "eval_best_f1_thresh": 0.0,
77
+ "eval_exact": 69.68752632022235,
78
+ "eval_f1": 73.38607950051639,
79
+ "eval_runtime": 136.2286,
80
+ "eval_samples_per_second": 89.342,
81
+ "eval_steps_per_second": 1.402,
82
+ "eval_total": 11873,
83
+ "step": 4000
84
+ },
85
+ {
86
+ "epoch": 0.5456033463671911,
87
+ "grad_norm": 52.56464767456055,
88
+ "learning_rate": 2.1815949804492137e-05,
89
+ "loss": 1.3977,
90
+ "step": 6000
91
+ },
92
+ {
93
+ "epoch": 0.5456033463671911,
94
+ "eval_HasAns_exact": 71.94669365721997,
95
+ "eval_HasAns_f1": 79.2064004599959,
96
+ "eval_HasAns_total": 5928,
97
+ "eval_NoAns_exact": 72.17830109335576,
98
+ "eval_NoAns_f1": 72.17830109335576,
99
+ "eval_NoAns_total": 5945,
100
+ "eval_best_exact": 72.07108565653162,
101
+ "eval_best_exact_thresh": 0.0,
102
+ "eval_best_f1": 75.69574176087386,
103
+ "eval_best_f1_thresh": 0.0,
104
+ "eval_exact": 72.0626631853786,
105
+ "eval_f1": 75.68731928972085,
106
+ "eval_runtime": 136.1854,
107
+ "eval_samples_per_second": 89.371,
108
+ "eval_steps_per_second": 1.403,
109
+ "eval_total": 11873,
110
+ "step": 6000
111
+ },
112
+ {
113
+ "epoch": 0.7274711284895881,
114
+ "grad_norm": 49.72623825073242,
115
+ "learning_rate": 1.908793307265618e-05,
116
+ "loss": 1.3384,
117
+ "step": 8000
118
+ },
119
+ {
120
+ "epoch": 0.7274711284895881,
121
+ "eval_HasAns_exact": 72.0310391363023,
122
+ "eval_HasAns_f1": 78.95689148837117,
123
+ "eval_HasAns_total": 5928,
124
+ "eval_NoAns_exact": 75.00420521446594,
125
+ "eval_NoAns_f1": 75.00420521446594,
126
+ "eval_NoAns_total": 5945,
127
+ "eval_best_exact": 73.51975069485387,
128
+ "eval_best_exact_thresh": 0.0,
129
+ "eval_best_f1": 76.9777185835984,
130
+ "eval_best_f1_thresh": 0.0,
131
+ "eval_exact": 73.51975069485387,
132
+ "eval_f1": 76.97771858359845,
133
+ "eval_runtime": 135.7796,
134
+ "eval_samples_per_second": 89.638,
135
+ "eval_steps_per_second": 1.407,
136
+ "eval_total": 11873,
137
+ "step": 8000
138
+ },
139
+ {
140
+ "epoch": 0.9093389106119851,
141
+ "grad_norm": 39.458927154541016,
142
+ "learning_rate": 1.6359916340820223e-05,
143
+ "loss": 1.2258,
144
+ "step": 10000
145
+ },
146
+ {
147
+ "epoch": 0.9093389106119851,
148
+ "eval_HasAns_exact": 73.54925775978407,
149
+ "eval_HasAns_f1": 80.29283351227244,
150
+ "eval_HasAns_total": 5928,
151
+ "eval_NoAns_exact": 76.23212783851976,
152
+ "eval_NoAns_f1": 76.23212783851976,
153
+ "eval_NoAns_total": 5945,
154
+ "eval_best_exact": 74.88419102164575,
155
+ "eval_best_exact_thresh": 0.0,
156
+ "eval_best_f1": 78.25115110424915,
157
+ "eval_best_f1_thresh": 0.0,
158
+ "eval_exact": 74.89261349279879,
159
+ "eval_f1": 78.25957357540227,
160
+ "eval_runtime": 136.1576,
161
+ "eval_samples_per_second": 89.389,
162
+ "eval_steps_per_second": 1.403,
163
+ "eval_total": 11873,
164
+ "step": 10000
165
+ },
166
+ {
167
+ "epoch": 1.0912066927343822,
168
+ "grad_norm": 41.23106002807617,
169
+ "learning_rate": 1.363189960898427e-05,
170
+ "loss": 0.7822,
171
+ "step": 12000
172
+ },
173
+ {
174
+ "epoch": 1.0912066927343822,
175
+ "eval_HasAns_exact": 77.26045883940621,
176
+ "eval_HasAns_f1": 84.1124672080756,
177
+ "eval_HasAns_total": 5928,
178
+ "eval_NoAns_exact": 69.97476871320437,
179
+ "eval_NoAns_f1": 69.97476871320437,
180
+ "eval_NoAns_total": 5945,
181
+ "eval_best_exact": 73.6208203486903,
182
+ "eval_best_exact_thresh": 0.0,
183
+ "eval_best_f1": 77.04191911138483,
184
+ "eval_best_f1_thresh": 0.0,
185
+ "eval_exact": 73.61239787753728,
186
+ "eval_f1": 77.0334966402318,
187
+ "eval_runtime": 135.9367,
188
+ "eval_samples_per_second": 89.534,
189
+ "eval_steps_per_second": 1.405,
190
+ "eval_total": 11873,
191
+ "step": 12000
192
+ },
193
+ {
194
+ "epoch": 1.273074474856779,
195
+ "grad_norm": 21.682905197143555,
196
+ "learning_rate": 1.0903882877148312e-05,
197
+ "loss": 0.6771,
198
+ "step": 14000
199
+ },
200
+ {
201
+ "epoch": 1.273074474856779,
202
+ "eval_HasAns_exact": 73.78542510121457,
203
+ "eval_HasAns_f1": 80.35769680092089,
204
+ "eval_HasAns_total": 5928,
205
+ "eval_NoAns_exact": 80.7569386038688,
206
+ "eval_NoAns_f1": 80.7569386038688,
207
+ "eval_NoAns_total": 5945,
208
+ "eval_best_exact": 77.27617282910806,
209
+ "eval_best_exact_thresh": 0.0,
210
+ "eval_best_f1": 80.55760352361308,
211
+ "eval_best_f1_thresh": 0.0,
212
+ "eval_exact": 77.27617282910806,
213
+ "eval_f1": 80.55760352361317,
214
+ "eval_runtime": 136.5688,
215
+ "eval_samples_per_second": 89.12,
216
+ "eval_steps_per_second": 1.399,
217
+ "eval_total": 11873,
218
+ "step": 14000
219
+ },
220
+ {
221
+ "epoch": 1.4549422569791761,
222
+ "grad_norm": 56.2855339050293,
223
+ "learning_rate": 8.175866145312359e-06,
224
+ "loss": 0.6521,
225
+ "step": 16000
226
+ },
227
+ {
228
+ "epoch": 1.4549422569791761,
229
+ "eval_HasAns_exact": 71.82860998650472,
230
+ "eval_HasAns_f1": 77.91336965584932,
231
+ "eval_HasAns_total": 5928,
232
+ "eval_NoAns_exact": 85.18082422203533,
233
+ "eval_NoAns_f1": 85.18082422203533,
234
+ "eval_NoAns_total": 5945,
235
+ "eval_best_exact": 78.52269855975743,
236
+ "eval_best_exact_thresh": 0.0,
237
+ "eval_best_f1": 81.56072225384261,
238
+ "eval_best_f1_thresh": 0.0,
239
+ "eval_exact": 78.51427608860439,
240
+ "eval_f1": 81.55229978268969,
241
+ "eval_runtime": 136.3366,
242
+ "eval_samples_per_second": 89.272,
243
+ "eval_steps_per_second": 1.401,
244
+ "eval_total": 11873,
245
+ "step": 16000
246
+ },
247
+ {
248
+ "epoch": 1.6368100391015732,
249
+ "grad_norm": 24.467727661132812,
250
+ "learning_rate": 5.447849413476403e-06,
251
+ "loss": 0.6455,
252
+ "step": 18000
253
+ },
254
+ {
255
+ "epoch": 1.6368100391015732,
256
+ "eval_HasAns_exact": 75.57354925775978,
257
+ "eval_HasAns_f1": 82.12994203860852,
258
+ "eval_HasAns_total": 5928,
259
+ "eval_NoAns_exact": 79.0412111017662,
260
+ "eval_NoAns_f1": 79.0412111017662,
261
+ "eval_NoAns_total": 5945,
262
+ "eval_best_exact": 77.31828518487325,
263
+ "eval_best_exact_thresh": 0.0,
264
+ "eval_best_f1": 80.59178778782702,
265
+ "eval_best_f1_thresh": 0.0,
266
+ "eval_exact": 77.30986271372021,
267
+ "eval_f1": 80.58336531667406,
268
+ "eval_runtime": 136.1893,
269
+ "eval_samples_per_second": 89.368,
270
+ "eval_steps_per_second": 1.402,
271
+ "eval_total": 11873,
272
+ "step": 18000
273
+ },
274
+ {
275
+ "epoch": 1.8186778212239703,
276
+ "grad_norm": 36.233985900878906,
277
+ "learning_rate": 2.7198326816404476e-06,
278
+ "loss": 0.6175,
279
+ "step": 20000
280
+ },
281
+ {
282
+ "epoch": 1.8186778212239703,
283
+ "eval_HasAns_exact": 74.19028340080972,
284
+ "eval_HasAns_f1": 80.57880057678263,
285
+ "eval_HasAns_total": 5928,
286
+ "eval_NoAns_exact": 83.46509671993272,
287
+ "eval_NoAns_f1": 83.46509671993272,
288
+ "eval_NoAns_total": 5945,
289
+ "eval_best_exact": 78.83432999241978,
290
+ "eval_best_exact_thresh": 0.0,
291
+ "eval_best_f1": 82.02401497676792,
292
+ "eval_best_f1_thresh": 0.0,
293
+ "eval_exact": 78.83432999241978,
294
+ "eval_f1": 82.02401497676809,
295
+ "eval_runtime": 136.3043,
296
+ "eval_samples_per_second": 89.293,
297
+ "eval_steps_per_second": 1.401,
298
+ "eval_total": 11873,
299
+ "step": 20000
300
+ },
301
+ {
302
+ "epoch": 2.0,
303
+ "step": 21994,
304
+ "total_flos": 4371201741330432.0,
305
+ "train_loss": 0.9652459149015072,
306
+ "train_runtime": 5408.776,
307
+ "train_samples_per_second": 48.794,
308
+ "train_steps_per_second": 4.066
309
+ }
310
+ ],
311
+ "logging_steps": 2000,
312
+ "max_steps": 21994,
313
+ "num_input_tokens_seen": 0,
314
+ "num_train_epochs": 2,
315
+ "save_steps": 2000,
316
+ "stateful_callbacks": {
317
+ "TrainerControl": {
318
+ "args": {
319
+ "should_epoch_stop": false,
320
+ "should_evaluate": false,
321
+ "should_log": false,
322
+ "should_save": true,
323
+ "should_training_stop": true
324
+ },
325
+ "attributes": {}
326
+ }
327
+ },
328
+ "total_flos": 4371201741330432.0,
329
+ "train_batch_size": 12,
330
+ "trial_name": null,
331
+ "trial_params": null
332
+ }
model/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de2c525ecfe7ce4b8f382b372daf75d3a2dc88321c507d37cee5f6b480f3c276
3
+ size 5176
requirements.txt ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ accelerate==0.34.2
2
+ aiofiles==23.2.1
3
+ aiohappyeyeballs==2.4.0
4
+ aiohttp==3.10.6
5
+ aiosignal==1.3.1
6
+ annotated-types==0.7.0
7
+ anyio==4.6.0
8
+ asttokens==2.4.1
9
+ attrs==24.2.0
10
+ beautifulsoup4==4.12.3
11
+ bleach==6.1.0
12
+ Brotli==1.1.0
13
+ certifi==2024.8.30
14
+ cffi==1.17.1
15
+ charset-normalizer==3.3.2
16
+ clearml==1.16.4
17
+ click==8.1.7
18
+ colorama==0.4.6
19
+ comm==0.2.2
20
+ contourpy==1.3.0
21
+ cycler==0.12.1
22
+ datasets==3.0.0
23
+ decorator==5.1.1
24
+ defusedxml==0.7.1
25
+ dill==0.3.8
26
+ dnspython==2.6.1
27
+ email_validator==2.2.0
28
+ entrypoints==0.4
29
+ evaluate==0.4.3
30
+ exceptiongroup==1.2.2
31
+ executing==2.1.0
32
+ fastapi==0.115.0
33
+ fastapi-cli==0.0.5
34
+ fastjsonschema==2.20.0
35
+ ffmpy==0.3.0
36
+ filelock==3.16.1
37
+ fonttools==4.54.1
38
+ frozenlist==1.4.1
39
+ fsspec==2024.6.1
40
+ furl==2.1.3
41
+ gmpy2==2.1.5
42
+ gradio==4.44.0
43
+ gradio_client==1.3.0
44
+ h11==0.14.0
45
+ h2==4.1.0
46
+ hpack==4.0.0
47
+ httpcore==1.0.5
48
+ httpx==0.27.2
49
+ huggingface_hub==0.25.1
50
+ hyperframe==6.0.1
51
+ idna==3.10
52
+ importlib_metadata==8.5.0
53
+ importlib_resources==6.4.5
54
+ ipython==8.27.0
55
+ ipywidgets==8.1.5
56
+ jedi==0.19.1
57
+ Jinja2==3.1.4
58
+ jsonschema==4.23.0
59
+ jsonschema-specifications==2023.12.1
60
+ jupyter_client==8.6.3
61
+ jupyter_core==5.7.2
62
+ jupyterlab_pygments==0.3.0
63
+ jupyterlab_widgets==3.0.13
64
+ kiwisolver==1.4.7
65
+ markdown-it-py==3.0.0
66
+ MarkupSafe==2.1.5
67
+ matplotlib==3.9.2
68
+ matplotlib-inline==0.1.7
69
+ mdurl==0.1.2
70
+ mistune==3.0.2
71
+ mpmath==1.3.0
72
+ multidict==6.1.0
73
+ multiprocess==0.70.16
74
+ munkres==1.1.4
75
+ nbclient==0.10.0
76
+ nbconvert==7.16.4
77
+ nbformat==5.10.4
78
+ networkx==3.3
79
+ numpy==1.26.4
80
+ orderedmultidict==1.0.1
81
+ orjson==3.10.7
82
+ packaging==24.1
83
+ pandas==2.2.3
84
+ pandocfilters==1.5.0
85
+ parso==0.8.4
86
+ pathlib2==2.3.7.post1
87
+ pexpect==4.9.0
88
+ pickleshare==0.7.5
89
+ pillow==10.4.0
90
+ pip==24.2
91
+ pkgutil_resolve_name==1.3.10
92
+ platformdirs==4.3.6
93
+ prompt_toolkit==3.0.48
94
+ psutil==6.0.0
95
+ ptyprocess==0.7.0
96
+ pure_eval==0.2.3
97
+ pyarrow==17.0.0
98
+ pycparser==2.22
99
+ pydantic==2.9.2
100
+ pydantic_core==2.23.4
101
+ pydub==0.25.1
102
+ Pygments==2.18.0
103
+ PyJWT==2.8.0
104
+ pyparsing==3.1.4
105
+ PySocks==1.7.1
106
+ python-dateutil==2.9.0
107
+ python-multipart==0.0.10
108
+ pytz==2024.1
109
+ PyYAML==6.0.2
110
+ pyzmq==26.2.0
111
+ referencing==0.35.1
112
+ regex==2024.9.11
113
+ requests==2.32.3
114
+ rich==13.8.1
115
+ rpds-py==0.20.0
116
+ ruff==0.6.7
117
+ safetensors==0.4.5
118
+ semantic-version==2.10.0
119
+ setuptools==75.1.0
120
+ shellingham==1.5.4
121
+ six==1.16.0
122
+ sniffio==1.3.1
123
+ soupsieve==2.5
124
+ stack-data==0.6.2
125
+ starlette==0.38.6
126
+ sympy==1.13.2
127
+ tinycss2==1.3.0
128
+ tokenizers==0.19.1
129
+ tomlkit==0.12.0
130
+ torch==2.4.1
131
+ torchaudio==2.4.1
132
+ torchvision==0.19.1
133
+ tornado==6.4.1
134
+ tqdm==4.66.5
135
+ traitlets==5.14.3
136
+ transformers==4.44.2
137
+ triton==3.0.0
138
+ typer==0.12.5
139
+ typer-slim==0.12.5
140
+ typing_extensions==4.12.2
141
+ tzdata==2024.2
142
+ urllib3==2.2.3
143
+ uvicorn==0.30.6
144
+ wcwidth==0.2.13
145
+ webencodings==0.5.1
146
+ websockets==12.0
147
+ wheel==0.44.0
148
+ widgetsnbextension==4.0.13
149
+ xxhash==3.5.0
150
+ yarl==1.12.1
151
+ zipp==3.20.2
152
+ zstandard==0.23.0