codenamewei commited on
Commit
b7f88d8
1 Parent(s): 54d4d9a

initial commit

Browse files
config.json ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "facebook/wav2vec2-conformer-rope-large-960h-ft",
3
+ "activation_dropout": 0.1,
4
+ "adapter_kernel_size": 3,
5
+ "adapter_stride": 2,
6
+ "add_adapter": false,
7
+ "apply_spec_augment": true,
8
+ "architectures": [
9
+ "Wav2Vec2ConformerForCTC"
10
+ ],
11
+ "attention_dropout": 0.1,
12
+ "bos_token_id": 1,
13
+ "classifier_proj_size": 256,
14
+ "codevector_dim": 768,
15
+ "conformer_conv_dropout": 0.1,
16
+ "contrastive_logits_temperature": 0.1,
17
+ "conv_bias": true,
18
+ "conv_depthwise_kernel_size": 31,
19
+ "conv_dim": [
20
+ 512,
21
+ 512,
22
+ 512,
23
+ 512,
24
+ 512,
25
+ 512,
26
+ 512
27
+ ],
28
+ "conv_kernel": [
29
+ 10,
30
+ 3,
31
+ 3,
32
+ 3,
33
+ 3,
34
+ 2,
35
+ 2
36
+ ],
37
+ "conv_stride": [
38
+ 5,
39
+ 2,
40
+ 2,
41
+ 2,
42
+ 2,
43
+ 2,
44
+ 2
45
+ ],
46
+ "ctc_loss_reduction": "sum",
47
+ "ctc_zero_infinity": false,
48
+ "diversity_loss_weight": 0.1,
49
+ "do_stable_layer_norm": true,
50
+ "eos_token_id": 2,
51
+ "feat_extract_activation": "gelu",
52
+ "feat_extract_dropout": 0.0,
53
+ "feat_extract_norm": "layer",
54
+ "feat_proj_dropout": 0.1,
55
+ "feat_quantizer_dropout": 0.0,
56
+ "final_dropout": 0.1,
57
+ "gradient_checkpointing": false,
58
+ "hidden_act": "swish",
59
+ "hidden_dropout": 0.1,
60
+ "hidden_dropout_prob": 0.1,
61
+ "hidden_size": 1024,
62
+ "initializer_range": 0.02,
63
+ "intermediate_size": 4096,
64
+ "layer_norm_eps": 1e-05,
65
+ "layerdrop": 0.0,
66
+ "mask_feature_length": 10,
67
+ "mask_feature_min_masks": 0,
68
+ "mask_feature_prob": 0.0,
69
+ "mask_time_length": 10,
70
+ "mask_time_min_masks": 2,
71
+ "mask_time_prob": 0.05,
72
+ "max_source_positions": 5000,
73
+ "model_type": "wav2vec2-conformer",
74
+ "num_adapter_layers": 3,
75
+ "num_attention_heads": 16,
76
+ "num_codevector_groups": 2,
77
+ "num_codevectors_per_group": 320,
78
+ "num_conv_pos_embedding_groups": 16,
79
+ "num_conv_pos_embeddings": 128,
80
+ "num_feat_extract_layers": 7,
81
+ "num_hidden_layers": 24,
82
+ "num_negatives": 100,
83
+ "output_hidden_size": 1024,
84
+ "pad_token_id": 29,
85
+ "position_embeddings_type": "rotary",
86
+ "proj_codevector_dim": 768,
87
+ "rotary_embedding_base": 10000,
88
+ "tdnn_dilation": [
89
+ 1,
90
+ 2,
91
+ 3,
92
+ 1,
93
+ 1
94
+ ],
95
+ "tdnn_dim": [
96
+ 512,
97
+ 512,
98
+ 512,
99
+ 512,
100
+ 1500
101
+ ],
102
+ "tdnn_kernel": [
103
+ 5,
104
+ 3,
105
+ 3,
106
+ 1,
107
+ 1
108
+ ],
109
+ "torch_dtype": "float32",
110
+ "transformers_version": "4.20.1",
111
+ "use_weighted_layer_sum": false,
112
+ "vocab_size": 32,
113
+ "xvector_output_dim": 512
114
+ }
preprocessor_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "feature_extractor_type": "Wav2Vec2FeatureExtractor",
4
+ "feature_size": 1,
5
+ "padding_side": "right",
6
+ "padding_value": 0.0,
7
+ "return_attention_mask": false,
8
+ "sampling_rate": 16000
9
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:580594ee9975f1c251b2470cd3d6e0193765b714cccdf25f97f6419bf6eef333
3
+ size 2374006415
special_tokens_map.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "eos_token": "</s>",
4
+ "pad_token": "[PAD]",
5
+ "unk_token": "[UNK]"
6
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "do_lower_case": false,
4
+ "eos_token": "</s>",
5
+ "pad_token": "[PAD]",
6
+ "replace_word_delimiter_char": " ",
7
+ "tokenizer_class": "Wav2Vec2CTCTokenizer",
8
+ "unk_token": "[UNK]",
9
+ "word_delimiter_token": "|"
10
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d16b5f9a88e3a9364cee3741aa6358951112bdc4da47d076a86bd0b9536279f
3
+ size 3439
training_args_tracker.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import TrainingArguments
2
+
3
+ steps = 200
4
+
5
+ training_args = TrainingArguments(
6
+ output_dir=outmodelpath,
7
+ overwrite_output_dir=True, #Set to true to overwrite output directory
8
+ group_by_length=True, # group data with same length to save memory (only for dynamic padding)
9
+ per_device_train_batch_size=8, #16
10
+ #save_strategy="steps",# The checkpoint save strategy to adopt during training.
11
+ evaluation_strategy="steps", # alternative: None, epoch
12
+ num_train_epochs=5, #50
13
+ #max_gradient_norm=0.8, #Maximum gradient norm (for gradient clipping). Default: 1.0
14
+ fp16=True, # Available only on GPU, when set true save memory
15
+ gradient_checkpointing=True, # save memory at the expense of slower backward pass
16
+ save_steps=steps,
17
+ eval_steps=steps,
18
+ logging_steps=steps,
19
+ learning_rate=1e-4, # default: 5e-5
20
+ weight_decay=0.005, # prevent overfitting, generalize better
21
+ warmup_ratio=0.1, # Ratio of total training steps used for a linear warmup from 0 to learning_rate. default 0.0
22
+ max_grad_norm=0.8,
23
+ save_total_limit=2, # number of checkpoint to save
24
+ load_best_model_at_end=True #load best model to save the best model in trainer.save_model
25
+ )
vocab.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "'": 7,
3
+ "[PAD]": 29,
4
+ "[UNK]": 28,
5
+ "a": 20,
6
+ "b": 22,
7
+ "c": 18,
8
+ "d": 21,
9
+ "e": 3,
10
+ "f": 17,
11
+ "g": 5,
12
+ "h": 2,
13
+ "i": 25,
14
+ "j": 1,
15
+ "k": 0,
16
+ "l": 12,
17
+ "m": 9,
18
+ "n": 8,
19
+ "o": 26,
20
+ "p": 13,
21
+ "q": 16,
22
+ "r": 14,
23
+ "s": 11,
24
+ "t": 6,
25
+ "u": 27,
26
+ "v": 10,
27
+ "w": 15,
28
+ "x": 19,
29
+ "y": 4,
30
+ "z": 24,
31
+ "|": 23
32
+ }