root@autodl-container-32ce119752-f4e7b2aa
commited on
Commit
•
97e9a54
1
Parent(s):
9fd2b49
model upload
Browse files- README.md +10 -0
- config.json +43 -0
- model.safetensors +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +55 -0
- train_log.txt +29 -0
- training_args.json +1 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## TextAttack Model Card
|
2 |
+
|
3 |
+
This `distilbert` model was fine-tuned using TextAttack. The model was fine-tuned
|
4 |
+
for 3 epochs with a batch size of 8,
|
5 |
+
a maximum sequence length of 512, and an initial learning rate of 3e-05.
|
6 |
+
Since this was a classification task, the model was trained with a cross-entropy loss function.
|
7 |
+
The best score the model achieved on this task was 0.9004, as measured by the
|
8 |
+
eval set accuracy, found after 3 epochs.
|
9 |
+
|
10 |
+
For more information, check out [TextAttack on Github](https://github.com/QData/TextAttack).
|
config.json
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "distilbert/distilbert-base-multilingual-cased",
|
3 |
+
"activation": "gelu",
|
4 |
+
"architectures": [
|
5 |
+
"DistilBertForSequenceClassification"
|
6 |
+
],
|
7 |
+
"attention_dropout": 0.1,
|
8 |
+
"dim": 768,
|
9 |
+
"dropout": 0.1,
|
10 |
+
"hidden_dim": 3072,
|
11 |
+
"id2label": {
|
12 |
+
"0": "Mainland China Politics",
|
13 |
+
"1": "HongKong Macau Politics",
|
14 |
+
"2": "International News",
|
15 |
+
"3": "Financial News",
|
16 |
+
"4": "Culture",
|
17 |
+
"5": "Entertainment",
|
18 |
+
"6": "Sports"
|
19 |
+
},
|
20 |
+
"initializer_range": 0.02,
|
21 |
+
"label2id": {
|
22 |
+
"Culture": 4,
|
23 |
+
"Entertainment": 5,
|
24 |
+
"Financial News": 3,
|
25 |
+
"HongKong Macau Politics": 1,
|
26 |
+
"International News": 2,
|
27 |
+
"Mainland China Politics": 0,
|
28 |
+
"Sports": 6
|
29 |
+
},
|
30 |
+
"max_position_embeddings": 512,
|
31 |
+
"model_type": "distilbert",
|
32 |
+
"n_heads": 12,
|
33 |
+
"n_layers": 6,
|
34 |
+
"output_past": true,
|
35 |
+
"pad_token_id": 0,
|
36 |
+
"qa_dropout": 0.1,
|
37 |
+
"seq_classif_dropout": 0.2,
|
38 |
+
"sinusoidal_pos_embds": false,
|
39 |
+
"tie_weights_": true,
|
40 |
+
"torch_dtype": "float32",
|
41 |
+
"transformers_version": "4.38.1",
|
42 |
+
"vocab_size": 119547
|
43 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:259c5aa25f7404d1f6c55ca81386d7406d70fc4c669bcc56c570442457f40ceb
|
3 |
+
size 541332756
|
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,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_lower_case": false,
|
47 |
+
"mask_token": "[MASK]",
|
48 |
+
"model_max_length": 512,
|
49 |
+
"pad_token": "[PAD]",
|
50 |
+
"sep_token": "[SEP]",
|
51 |
+
"strip_accents": null,
|
52 |
+
"tokenize_chinese_chars": true,
|
53 |
+
"tokenizer_class": "DistilBertTokenizer",
|
54 |
+
"unk_token": "[UNK]"
|
55 |
+
}
|
train_log.txt
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Writing logs to ./outputs/2024-03-01-10-24-35-896622/train_log.txt.
|
2 |
+
Wrote original training args to ./outputs/2024-03-01-10-24-35-896622/training_args.json.
|
3 |
+
***** Running training *****
|
4 |
+
Num examples = 50000
|
5 |
+
Num epochs = 3
|
6 |
+
Num clean epochs = 3
|
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 = 18750
|
11 |
+
==========================================================
|
12 |
+
Epoch 1
|
13 |
+
Running clean epoch 1/3
|
14 |
+
Train accuracy: 83.54%
|
15 |
+
Eval accuracy: 88.30%
|
16 |
+
Best score found. Saved model to ./outputs/2024-03-01-10-24-35-896622/best_model/
|
17 |
+
==========================================================
|
18 |
+
Epoch 2
|
19 |
+
Running clean epoch 2/3
|
20 |
+
Train accuracy: 91.31%
|
21 |
+
Eval accuracy: 89.43%
|
22 |
+
Best score found. Saved model to ./outputs/2024-03-01-10-24-35-896622/best_model/
|
23 |
+
==========================================================
|
24 |
+
Epoch 3
|
25 |
+
Running clean epoch 3/3
|
26 |
+
Train accuracy: 95.09%
|
27 |
+
Eval accuracy: 90.04%
|
28 |
+
Best score found. Saved model to ./outputs/2024-03-01-10-24-35-896622/best_model/
|
29 |
+
Wrote README to ./outputs/2024-03-01-10-24-35-896622/README.md.
|
training_args.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"num_epochs": 3, "num_clean_epochs": 1, "attack_epoch_interval": 1, "early_stopping_epochs": null, "learning_rate": 3e-05, "num_warmup_steps": 500, "weight_decay": 0.01, "per_device_train_batch_size": 8, "per_device_eval_batch_size": 32, "gradient_accumulation_steps": 1, "random_seed": 718, "parallel": false, "load_best_model_at_end": false, "alpha": 1.0, "num_train_adv_examples": -1, "query_budget_train": null, "attack_num_workers_per_device": 1, "output_dir": "./outputs/2024-03-01-10-24-35-896622", "checkpoint_interval_steps": null, "checkpoint_interval_epochs": null, "save_last": true, "log_to_tb": false, "tb_log_dir": null, "log_to_wandb": false, "wandb_project": "textattack", "logging_interval_step": 1}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|