Bakobiibizo commited on
Commit
e302db6
1 Parent(s): 57241f6

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ ## TextAttack Model Card
2
+
3
+ This `lstm` model was fine-tuned using TextAttackand the *yelp_polarity* dataset loaded using the huggingface library. The model was fine-tuned for 50 epochs with a batch size of 8, a maximum sequence length of 128, and an initial learning rate of 1e-05.
4
+ Since this was a classification task, the model was trained with a cross-entropy loss function. The best score the model achieved on this task was 0.9174473684210527, as measured by the eval set accuracy, found after 28 epochs.
5
+
6
+ For more information on the source repo, check out [TextAttack on Github](https://github.com/QData/TextAttack).
config copy.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForSequenceClassification"
4
+ ],
5
+ "model_name": "my_model",
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "finetuning_task": "yelp_polarity",
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
+ "type_vocab_size": 2,
21
+ "vocab_size": 30522
22
+ }
config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "finetuning_task": "yelp_polarity",
7
+ "gradient_checkpointing": false,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 3072,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "pad_token_id": 0,
19
+ "type_vocab_size": 2,
20
+ "vocab_size": 30522
21
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c70002c363b84cb50fc02d63e9ebbc2bca966638b2958446c5a51094c7348c2e
3
+ size 320670479
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"do_lower_case": true, "model_max_length": 512}
train_log.txt ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Writing logs to ./outputs/2024-03-22-01-16-17-693140/train_log.txt.
2
+ Wrote original training args to ./outputs/2024-03-22-01-16-17-693140/training_args.json.
3
+ ***** Running training *****
4
+ Num examples = 560000
5
+ Num epochs = 50
6
+ Num clean epochs = 50
7
+ Instantaneous batch size per device = 8
8
+ Total train batch size (w. parallel, distributed & accumulation) = 8
9
+ Gradient accumulation steps = 1
10
+ Total optimization steps = 3500000
11
+ ==========================================================
12
+ Epoch 1
13
+ Running clean epoch 1/50
14
+ Train accuracy: 81.85%
15
+ Eval accuracy: 88.42%
16
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
17
+ ==========================================================
18
+ Epoch 2
19
+ Running clean epoch 2/50
20
+ Train accuracy: 88.95%
21
+ Eval accuracy: 88.87%
22
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
23
+ ==========================================================
24
+ Epoch 3
25
+ Running clean epoch 3/50
26
+ Train accuracy: 89.65%
27
+ Eval accuracy: 89.58%
28
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
29
+ ==========================================================
30
+ Epoch 4
31
+ Running clean epoch 4/50
32
+ Train accuracy: 90.02%
33
+ Eval accuracy: 89.53%
34
+ ==========================================================
35
+ Epoch 5
36
+ Running clean epoch 5/50
37
+ Train accuracy: 90.22%
38
+ Eval accuracy: 89.73%
39
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
40
+ ==========================================================
41
+ Epoch 6
42
+ Running clean epoch 6/50
43
+ Train accuracy: 90.43%
44
+ Eval accuracy: 89.60%
45
+ ==========================================================
46
+ Epoch 7
47
+ Running clean epoch 7/50
48
+ Train accuracy: 90.64%
49
+ Eval accuracy: 89.83%
50
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
51
+ ==========================================================
52
+ Epoch 8
53
+ Running clean epoch 8/50
54
+ Train accuracy: 90.79%
55
+ Eval accuracy: 90.04%
56
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
57
+ ==========================================================
58
+ Epoch 9
59
+ Running clean epoch 9/50
60
+ Train accuracy: 90.97%
61
+ Eval accuracy: 90.22%
62
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
63
+ ==========================================================
64
+ Epoch 10
65
+ Running clean epoch 10/50
66
+ Train accuracy: 91.16%
67
+ Eval accuracy: 90.33%
68
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
69
+ ==========================================================
70
+ Epoch 11
71
+ Running clean epoch 11/50
72
+ Train accuracy: 91.37%
73
+ Eval accuracy: 90.50%
74
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
75
+ ==========================================================
76
+ Epoch 12
77
+ Running clean epoch 12/50
78
+ Train accuracy: 91.58%
79
+ Eval accuracy: 90.42%
80
+ ==========================================================
81
+ Epoch 13
82
+ Running clean epoch 13/50
83
+ Train accuracy: 91.81%
84
+ Eval accuracy: 90.64%
85
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
86
+ ==========================================================
87
+ Epoch 14
88
+ Running clean epoch 14/50
89
+ Train accuracy: 92.01%
90
+ Eval accuracy: 90.71%
91
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
92
+ ==========================================================
93
+ Epoch 15
94
+ Running clean epoch 15/50
95
+ Train accuracy: 92.23%
96
+ Eval accuracy: 90.88%
97
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
98
+ ==========================================================
99
+ Epoch 16
100
+ Running clean epoch 16/50
101
+ Train accuracy: 92.41%
102
+ Eval accuracy: 90.95%
103
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
104
+ ==========================================================
105
+ Epoch 17
106
+ Running clean epoch 17/50
107
+ Train accuracy: 92.59%
108
+ Eval accuracy: 90.72%
109
+ ==========================================================
110
+ Epoch 18
111
+ Running clean epoch 18/50
112
+ Train accuracy: 92.78%
113
+ Eval accuracy: 91.12%
114
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
115
+ ==========================================================
116
+ Epoch 19
117
+ Running clean epoch 19/50
118
+ Train accuracy: 92.97%
119
+ Eval accuracy: 91.19%
120
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
121
+ ==========================================================
122
+ Epoch 20
123
+ Running clean epoch 20/50
124
+ Train accuracy: 93.12%
125
+ Eval accuracy: 91.43%
126
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
127
+ ==========================================================
128
+ Epoch 21
129
+ Running clean epoch 21/50
130
+ Train accuracy: 93.28%
131
+ Eval accuracy: 91.47%
132
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
133
+ ==========================================================
134
+ Epoch 22
135
+ Running clean epoch 22/50
136
+ Train accuracy: 93.42%
137
+ Eval accuracy: 91.52%
138
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
139
+ ==========================================================
140
+ Epoch 23
141
+ Running clean epoch 23/50
142
+ Train accuracy: 93.54%
143
+ Eval accuracy: 91.71%
144
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
145
+ ==========================================================
146
+ Epoch 24
147
+ Running clean epoch 24/50
148
+ Train accuracy: 93.69%
149
+ Eval accuracy: 91.61%
150
+ ==========================================================
151
+ Epoch 25
152
+ Running clean epoch 25/50
153
+ Train accuracy: 93.86%
154
+ Eval accuracy: 91.69%
155
+ ==========================================================
156
+ Epoch 26
157
+ Running clean epoch 26/50
158
+ Train accuracy: 93.98%
159
+ Eval accuracy: 91.63%
160
+ ==========================================================
161
+ Epoch 27
162
+ Running clean epoch 27/50
163
+ Train accuracy: 94.12%
164
+ Eval accuracy: 91.57%
165
+ ==========================================================
166
+ Epoch 28
167
+ Running clean epoch 28/50
168
+ Train accuracy: 94.24%
169
+ Eval accuracy: 91.74%
170
+ Best score found. Saved model to ./outputs/2024-03-22-01-16-17-693140/best_model/
171
+ ==========================================================
172
+ Epoch 29
173
+ Running clean epoch 29/50
174
+ Train accuracy: 94.37%
175
+ Eval accuracy: 91.73%
176
+ ==========================================================
177
+ Epoch 30
178
+ Running clean epoch 30/50
179
+ Train accuracy: 94.47%
180
+ Eval accuracy: 91.45%
181
+ ==========================================================
182
+ Epoch 31
183
+ Running clean epoch 31/50
184
+ Train accuracy: 94.62%
185
+ Eval accuracy: 91.34%
186
+ ==========================================================
187
+ Epoch 32
188
+ Running clean epoch 32/50
189
+ Train accuracy: 94.72%
190
+ Eval accuracy: 91.58%
191
+ ==========================================================
192
+ Epoch 33
193
+ Running clean epoch 33/50
194
+ Train accuracy: 94.86%
195
+ Eval accuracy: 91.61%
196
+ ==========================================================
197
+ Epoch 34
198
+ Running clean epoch 34/50
199
+ Train accuracy: 94.96%
200
+ Eval accuracy: 91.70%
201
+ ==========================================================
202
+ Epoch 35
203
+ Running clean epoch 35/50
204
+ Train accuracy: 95.06%
205
+ Eval accuracy: 91.65%
206
+ ==========================================================
207
+ Epoch 36
208
+ Running clean epoch 36/50
209
+ Train accuracy: 95.17%
210
+ Eval accuracy: 91.71%
211
+ ==========================================================
212
+ Epoch 37
213
+ Running clean epoch 37/50
214
+ Train accuracy: 95.28%
215
+ Eval accuracy: 91.58%
216
+ ==========================================================
217
+ Epoch 38
218
+ Running clean epoch 38/50
219
+ Train accuracy: 95.37%
220
+ Eval accuracy: 91.52%
221
+ ==========================================================
222
+ Epoch 39
223
+ Running clean epoch 39/50
224
+ Train accuracy: 95.49%
225
+ Eval accuracy: 91.10%
226
+ ==========================================================
227
+ Epoch 40
228
+ Running clean epoch 40/50
229
+ Train accuracy: 95.58%
230
+ Eval accuracy: 91.54%
231
+ ==========================================================
232
+ Epoch 41
233
+ Running clean epoch 41/50
234
+ Train accuracy: 95.68%
235
+ Eval accuracy: 91.37%
236
+ ==========================================================
237
+ Epoch 42
238
+ Running clean epoch 42/50
239
+ Train accuracy: 95.76%
240
+ Eval accuracy: 91.34%
241
+ ==========================================================
242
+ Epoch 43
243
+ Running clean epoch 43/50
244
+ Train accuracy: 95.85%
245
+ Eval accuracy: 91.01%
246
+ ==========================================================
247
+ Epoch 44
248
+ Running clean epoch 44/50
249
+ Train accuracy: 95.95%
250
+ Eval accuracy: 91.35%
251
+ ==========================================================
252
+ Epoch 45
253
+ Running clean epoch 45/50
254
+ Train accuracy: 96.03%
255
+ Eval accuracy: 91.23%
256
+ ==========================================================
257
+ Epoch 46
258
+ Running clean epoch 46/50
259
+ Train accuracy: 96.10%
260
+ Eval accuracy: 91.19%
261
+ ==========================================================
262
+ Epoch 47
263
+ Running clean epoch 47/50
264
+ Train accuracy: 96.18%
265
+ Eval accuracy: 91.14%
266
+ ==========================================================
267
+ Epoch 48
268
+ Running clean epoch 48/50
269
+ Train accuracy: 96.29%
270
+ Eval accuracy: 91.27%
271
+ ==========================================================
272
+ Epoch 49
273
+ Running clean epoch 49/50
274
+ Train accuracy: 96.39%
275
+ Eval accuracy: 91.14%
276
+ ==========================================================
277
+ Epoch 50
278
+ Running clean epoch 50/50
279
+ Train accuracy: 96.46%
280
+ Eval accuracy: 91.11%
281
+ Wrote README to ./outputs/2024-03-22-01-16-17-693140/README.md.
training_args copy.json ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "output_dir": "my_model",
3
+ "overwrite_output_dir": false,
4
+ "do_train": false,
5
+ "do_eval": false,
6
+ "do_predict": false,
7
+ "evaluation_strategy": "no",
8
+ "prediction_loss_only": false,
9
+ "per_device_train_batch_size": 8,
10
+ "per_device_eval_batch_size": 8,
11
+ "per_gpu_train_batch_size": null,
12
+ "per_gpu_eval_batch_size": null,
13
+ "gradient_accumulation_steps": 1,
14
+ "eval_accumulation_steps": null,
15
+ "eval_delay": 0,
16
+ "learning_rate": 5e-05,
17
+ "weight_decay": 0.0,
18
+ "adam_beta1": 0.9,
19
+ "adam_beta2": 0.999,
20
+ "adam_epsilon": 1e-08,
21
+ "max_grad_norm": 1.0,
22
+ "num_train_epochs": 3.0,
23
+ "max_steps": -1,
24
+ "lr_scheduler_type": "linear",
25
+ "lr_scheduler_kwargs": {},
26
+ "warmup_ratio": 0.0,
27
+ "warmup_steps": 0,
28
+ "log_level": "passive",
29
+ "log_level_replica": "warning",
30
+ "log_on_each_node": true,
31
+ "logging_dir": "my_model/training_args.json/runs/Mar22_01-08-45_dsmtyh100xx0153",
32
+ "logging_strategy": "steps",
33
+ "logging_first_step": false,
34
+ "logging_steps": 500,
35
+ "logging_nan_inf_filter": true,
36
+ "save_strategy": "steps",
37
+ "save_steps": 500,
38
+ "save_total_limit": null,
39
+ "save_safetensors": true,
40
+ "save_on_each_node": false,
41
+ "save_only_model": false,
42
+ "no_cuda": false,
43
+ "use_cpu": false,
44
+ "use_mps_device": false,
45
+ "seed": 42,
46
+ "data_seed": null,
47
+ "jit_mode_eval": false,
48
+ "use_ipex": false,
49
+ "bf16": false,
50
+ "fp16": false,
51
+ "fp16_opt_level": "O1",
52
+ "half_precision_backend": "auto",
53
+ "bf16_full_eval": false,
54
+ "fp16_full_eval": false,
55
+ "tf32": null,
56
+ "local_rank": 0,
57
+ "ddp_backend": null,
58
+ "tpu_num_cores": null,
59
+ "tpu_metrics_debug": false,
60
+ "debug": [],
61
+ "dataloader_drop_last": false,
62
+ "eval_steps": null,
63
+ "dataloader_num_workers": 0,
64
+ "dataloader_prefetch_factor": null,
65
+ "past_index": -1,
66
+ "run_name": "my_model",
67
+ "disable_tqdm": false,
68
+ "remove_unused_columns": true,
69
+ "label_names": null,
70
+ "load_best_model_at_end": false,
71
+ "metric_for_best_model": null,
72
+ "greater_is_better": null,
73
+ "ignore_data_skip": false,
74
+ "fsdp": [],
75
+ "fsdp_min_num_params": 0,
76
+ "fsdp_config": {
77
+ "min_num_params": 0,
78
+ "xla": false,
79
+ "xla_fsdp_v2": false,
80
+ "xla_fsdp_grad_ckpt": false
81
+ },
82
+ "fsdp_transformer_layer_cls_to_wrap": null,
83
+ "accelerator_config": {
84
+ "split_batches": false,
85
+ "dispatch_batches": null,
86
+ "even_batches": true,
87
+ "use_seedable_sampler": true
88
+ },
89
+ "deepspeed": null,
90
+ "label_smoothing_factor": 0.0,
91
+ "optim": "adamw_torch",
92
+ "optim_args": null,
93
+ "adafactor": false,
94
+ "group_by_length": false,
95
+ "length_column_name": "length",
96
+ "report_to": [],
97
+ "ddp_find_unused_parameters": null,
98
+ "ddp_bucket_cap_mb": null,
99
+ "ddp_broadcast_buffers": null,
100
+ "dataloader_pin_memory": true,
101
+ "dataloader_persistent_workers": false,
102
+ "skip_memory_metrics": true,
103
+ "use_legacy_prediction_loop": false,
104
+ "push_to_hub": false,
105
+ "resume_from_checkpoint": null,
106
+ "hub_model_id": null,
107
+ "hub_strategy": "every_save",
108
+ "hub_token": "<HUB_TOKEN>",
109
+ "hub_private_repo": false,
110
+ "hub_always_push": false,
111
+ "gradient_checkpointing": false,
112
+ "gradient_checkpointing_kwargs": null,
113
+ "include_inputs_for_metrics": false,
114
+ "fp16_backend": "auto",
115
+ "push_to_hub_model_id": null,
116
+ "push_to_hub_organization": null,
117
+ "push_to_hub_token": "<PUSH_TO_HUB_TOKEN>",
118
+ "mp_parameters": "",
119
+ "auto_find_batch_size": false,
120
+ "full_determinism": false,
121
+ "torchdynamo": null,
122
+ "ray_scope": "last",
123
+ "ddp_timeout": 1800,
124
+ "torch_compile": false,
125
+ "torch_compile_backend": null,
126
+ "torch_compile_mode": null,
127
+ "dispatch_batches": null,
128
+ "split_batches": null,
129
+ "include_tokens_per_second": false,
130
+ "include_num_input_tokens_seen": false,
131
+ "neftune_noise_alpha": null
132
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d353037f945468aa95fe1a5029d9a81e6ddc9e0c380a50912a7731a06f54c0ee
3
+ size 203
training_args.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_name_or_path": "lstm",
3
+ "attack": null,
4
+ "dataset": "yelp_polarity",
5
+ "task_type": "classification",
6
+ "model_max_length": null,
7
+ "model_num_labels": null,
8
+ "dataset_train_split": "train",
9
+ "dataset_eval_split": "test",
10
+ "filter_train_by_labels": null,
11
+ "filter_eval_by_labels": null,
12
+ "num_epochs": 50,
13
+ "num_clean_epochs": 1,
14
+ "attack_epoch_interval": 1,
15
+ "early_stopping_epochs": null,
16
+ "learning_rate": 1e-05,
17
+ "num_warmup_steps": 500,
18
+ "weight_decay": 0.01,
19
+ "per_device_train_batch_size": 8,
20
+ "per_device_eval_batch_size": 32,
21
+ "gradient_accumulation_steps": 1,
22
+ "random_seed": 786,
23
+ "parallel": false,
24
+ "load_best_model_at_end": false,
25
+ "alpha": 1.0,
26
+ "num_train_adv_examples": -1,
27
+ "query_budget_train": null,
28
+ "attack_num_workers_per_device": 1,
29
+ "output_dir": "./outputs/2024-03-22-01-16-17-693140",
30
+ "checkpoint_interval_steps": null,
31
+ "checkpoint_interval_epochs": null,
32
+ "save_last": true,
33
+ "log_to_tb": false,
34
+ "tb_log_dir": null,
35
+ "log_to_wandb": false,
36
+ "wandb_project": "textattack",
37
+ "logging_interval_step": 1
38
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff