eligapris commited on
Commit
99a8ecf
1 Parent(s): d66c231

Upload ONNX model with documentation

Browse files
README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ tags:
4
+ - onnx
5
+ - transformers.js
6
+ ---
7
+
8
+ # eligapris/microsoft-speecht5_tts-ONNX
9
+
10
+ This is an ONNX-converted version of the model for use with [🤗 Transformers.js](https://github.com/xenova/transformers.js).
11
+
12
+ ## Usage
13
+
14
+ ```javascript
15
+ import { pipeline } from '@xenova/transformers';
16
+
17
+ // Load the model
18
+ const model = await pipeline('task-type', 'eligapris/microsoft-speecht5_tts-ONNX');
19
+
20
+ // Use the model
21
+ // Check the original model's documentation for specific usage instructions
22
+ ```
23
+
24
+ ## Original Model
25
+
26
+ This model was converted from the original HuggingFace model. Please refer to the original model's documentation for detailed information about its architecture, training, and usage.
27
+
28
+ ## Conversion Details
29
+
30
+ This model was converted to ONNX format using the Transformers.js conversion script. The conversion includes quantization for optimal performance.
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<ctc_blank>": 80,
3
+ "<mask>": 79
4
+ }
config.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "microsoft/speecht5_tts",
3
+ "activation_dropout": 0.1,
4
+ "apply_spec_augment": true,
5
+ "architectures": [
6
+ "SpeechT5ForTextToSpeech"
7
+ ],
8
+ "attention_dropout": 0.1,
9
+ "bos_token_id": 0,
10
+ "conv_bias": false,
11
+ "conv_dim": [
12
+ 512,
13
+ 512,
14
+ 512,
15
+ 512,
16
+ 512,
17
+ 512,
18
+ 512
19
+ ],
20
+ "conv_kernel": [
21
+ 10,
22
+ 3,
23
+ 3,
24
+ 3,
25
+ 3,
26
+ 2,
27
+ 2
28
+ ],
29
+ "conv_stride": [
30
+ 5,
31
+ 2,
32
+ 2,
33
+ 2,
34
+ 2,
35
+ 2,
36
+ 2
37
+ ],
38
+ "decoder_attention_heads": 12,
39
+ "decoder_ffn_dim": 3072,
40
+ "decoder_layerdrop": 0.1,
41
+ "decoder_layers": 6,
42
+ "decoder_start_token_id": 2,
43
+ "encoder_attention_heads": 12,
44
+ "encoder_ffn_dim": 3072,
45
+ "encoder_layerdrop": 0.1,
46
+ "encoder_layers": 12,
47
+ "encoder_max_relative_position": 160,
48
+ "eos_token_id": 2,
49
+ "feat_extract_activation": "gelu",
50
+ "feat_extract_norm": "group",
51
+ "feat_proj_dropout": 0.0,
52
+ "guided_attention_loss_num_heads": 2,
53
+ "guided_attention_loss_scale": 10.0,
54
+ "guided_attention_loss_sigma": 0.4,
55
+ "hidden_act": "gelu",
56
+ "hidden_dropout": 0.1,
57
+ "hidden_size": 768,
58
+ "initializer_range": 0.02,
59
+ "is_encoder_decoder": true,
60
+ "layer_norm_eps": 1e-05,
61
+ "mask_feature_length": 10,
62
+ "mask_feature_min_masks": 0,
63
+ "mask_feature_prob": 0.0,
64
+ "mask_time_length": 10,
65
+ "mask_time_min_masks": 2,
66
+ "mask_time_prob": 0.05,
67
+ "max_length": 1876,
68
+ "max_speech_positions": 1876,
69
+ "max_text_positions": 600,
70
+ "model_type": "speecht5",
71
+ "num_conv_pos_embedding_groups": 16,
72
+ "num_conv_pos_embeddings": 128,
73
+ "num_feat_extract_layers": 7,
74
+ "num_mel_bins": 80,
75
+ "pad_token_id": 1,
76
+ "positional_dropout": 0.1,
77
+ "reduction_factor": 2,
78
+ "scale_embedding": false,
79
+ "speaker_embedding_dim": 512,
80
+ "speech_decoder_postnet_dropout": 0.5,
81
+ "speech_decoder_postnet_kernel": 5,
82
+ "speech_decoder_postnet_layers": 5,
83
+ "speech_decoder_postnet_units": 256,
84
+ "speech_decoder_prenet_dropout": 0.5,
85
+ "speech_decoder_prenet_layers": 2,
86
+ "speech_decoder_prenet_units": 256,
87
+ "transformers_version": "4.35.2",
88
+ "use_cache": true,
89
+ "use_guided_attention_loss": true,
90
+ "vocab_size": 81
91
+ }
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "decoder_start_token_id": 2,
5
+ "eos_token_id": 2,
6
+ "max_length": 1876,
7
+ "pad_token_id": 1,
8
+ "transformers_version": "4.35.2"
9
+ }
onnx/decoder_model_merged.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8328a9ebe4f7801996d2efe1768daba6747644b9b7d52bb3ab3b2d10766fd0df
3
+ size 55432027
onnx/decoder_model_merged_quantized.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:177985092ae92d5b798e5105b60491bf8e1967f70e76969e57477385462e7da0
3
+ size 18251673
preprocessor_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": false,
3
+ "feature_extractor_type": "SpeechT5FeatureExtractor",
4
+ "feature_size": 1,
5
+ "fmax": 7600,
6
+ "fmin": 80,
7
+ "frame_signal_scale": 1.0,
8
+ "hop_length": 16,
9
+ "mel_floor": 1e-10,
10
+ "num_mel_bins": 80,
11
+ "padding_side": "right",
12
+ "padding_value": 0.0,
13
+ "processor_class": "SpeechT5Processor",
14
+ "reduction_factor": 2,
15
+ "return_attention_mask": true,
16
+ "sampling_rate": 16000,
17
+ "win_function": "hann_window",
18
+ "win_length": 64
19
+ }
quantize_config.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "per_channel": true,
3
+ "reduce_range": true,
4
+ "per_model_config": {
5
+ "encoder_model": {
6
+ "op_types": [
7
+ "Div",
8
+ "Erf",
9
+ "Add",
10
+ "Slice",
11
+ "Unsqueeze",
12
+ "ConstantOfShape",
13
+ "Range",
14
+ "ReduceMean",
15
+ "Sub",
16
+ "Equal",
17
+ "Reshape",
18
+ "Shape",
19
+ "Gather",
20
+ "Mul",
21
+ "Pow",
22
+ "Expand",
23
+ "Less",
24
+ "Transpose",
25
+ "Sqrt",
26
+ "Constant",
27
+ "Concat",
28
+ "Cast",
29
+ "Softmax",
30
+ "MatMul",
31
+ "Not",
32
+ "Where"
33
+ ],
34
+ "weight_type": "QInt8"
35
+ },
36
+ "decoder_model": {
37
+ "op_types": [
38
+ "Div",
39
+ "Erf",
40
+ "Relu",
41
+ "Add",
42
+ "Slice",
43
+ "Unsqueeze",
44
+ "Greater",
45
+ "Clip",
46
+ "ConstantOfShape",
47
+ "ReduceL2",
48
+ "ReduceMean",
49
+ "Sub",
50
+ "Equal",
51
+ "Reshape",
52
+ "RandomUniformLike",
53
+ "Sigmoid",
54
+ "Shape",
55
+ "Gather",
56
+ "Mul",
57
+ "Transpose",
58
+ "Expand",
59
+ "Pow",
60
+ "Sqrt",
61
+ "Constant",
62
+ "Concat",
63
+ "Cast",
64
+ "Softmax",
65
+ "MatMul",
66
+ "Where"
67
+ ],
68
+ "weight_type": "QInt8"
69
+ },
70
+ "decoder_with_past_model": {
71
+ "op_types": [
72
+ "Div",
73
+ "Erf",
74
+ "Relu",
75
+ "Add",
76
+ "Slice",
77
+ "Unsqueeze",
78
+ "Greater",
79
+ "Clip",
80
+ "ConstantOfShape",
81
+ "ReduceL2",
82
+ "ReduceMean",
83
+ "Sub",
84
+ "Equal",
85
+ "Reshape",
86
+ "RandomUniformLike",
87
+ "Sigmoid",
88
+ "Shape",
89
+ "Gather",
90
+ "Mul",
91
+ "Transpose",
92
+ "Expand",
93
+ "Pow",
94
+ "Sqrt",
95
+ "Constant",
96
+ "Concat",
97
+ "Cast",
98
+ "Softmax",
99
+ "MatMul",
100
+ "Where"
101
+ ],
102
+ "weight_type": "QInt8"
103
+ },
104
+ "decoder_postnet_and_vocoder": {
105
+ "op_types": [
106
+ "ConvTranspose",
107
+ "Squeeze",
108
+ "Div",
109
+ "Constant",
110
+ "Tanh",
111
+ "Add",
112
+ "LeakyRelu",
113
+ "Sub",
114
+ "Conv",
115
+ "Transpose",
116
+ "Unsqueeze",
117
+ "Reshape"
118
+ ],
119
+ "weight_type": "QUInt8"
120
+ }
121
+ }
122
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "eos_token": "</s>",
4
+ "mask_token": {
5
+ "content": "<mask>",
6
+ "lstrip": true,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false
10
+ },
11
+ "pad_token": "<pad>",
12
+ "unk_token": "<unk>"
13
+ }
spm_char.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7fcc48f3e225f627b1641db410ceb0c8649bd2b0c982e150b03f8be3728ab560
3
+ size 238473
tokenizer.json ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "1.0",
3
+ "truncation": null,
4
+ "padding": null,
5
+ "added_tokens": [
6
+ {
7
+ "id": 0,
8
+ "content": "<s>",
9
+ "single_word": false,
10
+ "lstrip": false,
11
+ "rstrip": false,
12
+ "normalized": false,
13
+ "special": true
14
+ },
15
+ {
16
+ "id": 1,
17
+ "content": "<pad>",
18
+ "single_word": false,
19
+ "lstrip": false,
20
+ "rstrip": false,
21
+ "normalized": false,
22
+ "special": true
23
+ },
24
+ {
25
+ "id": 2,
26
+ "content": "</s>",
27
+ "single_word": false,
28
+ "lstrip": false,
29
+ "rstrip": false,
30
+ "normalized": false,
31
+ "special": true
32
+ },
33
+ {
34
+ "id": 3,
35
+ "content": "<unk>",
36
+ "single_word": false,
37
+ "lstrip": false,
38
+ "rstrip": false,
39
+ "normalized": false,
40
+ "special": true
41
+ },
42
+ {
43
+ "id": 79,
44
+ "content": "<mask>",
45
+ "single_word": false,
46
+ "lstrip": false,
47
+ "rstrip": false,
48
+ "normalized": false,
49
+ "special": true
50
+ },
51
+ {
52
+ "id": 80,
53
+ "content": "<ctc_blank>",
54
+ "single_word": false,
55
+ "lstrip": false,
56
+ "rstrip": false,
57
+ "normalized": false,
58
+ "special": true
59
+ }
60
+ ],
61
+ "normalizer": {
62
+ "type": "Precompiled",
63
+ "precompiled_charsmap": null
64
+ },
65
+ "pre_tokenizer": {
66
+ "type": "Sequence",
67
+ "pretokenizers": [
68
+ {
69
+ "type": "WhitespaceSplit"
70
+ },
71
+ {
72
+ "type": "Metaspace",
73
+ "replacement": "\u2581",
74
+ "add_prefix_space": true
75
+ },
76
+ {
77
+ "type": "Split",
78
+ "pattern": {
79
+ "Regex": ""
80
+ },
81
+ "behavior": "Isolated",
82
+ "invert": false
83
+ }
84
+ ]
85
+ },
86
+ "post_processor": {
87
+ "type": "TemplateProcessing",
88
+ "single": [
89
+ {
90
+ "Sequence": {
91
+ "id": "A",
92
+ "type_id": 0
93
+ }
94
+ },
95
+ {
96
+ "SpecialToken": {
97
+ "id": "</s>",
98
+ "type_id": 0
99
+ }
100
+ }
101
+ ],
102
+ "pair": [
103
+ {
104
+ "Sequence": {
105
+ "id": "A",
106
+ "type_id": 0
107
+ }
108
+ },
109
+ {
110
+ "SpecialToken": {
111
+ "id": "</s>",
112
+ "type_id": 0
113
+ }
114
+ },
115
+ {
116
+ "Sequence": {
117
+ "id": "B",
118
+ "type_id": 0
119
+ }
120
+ },
121
+ {
122
+ "SpecialToken": {
123
+ "id": "</s>",
124
+ "type_id": 0
125
+ }
126
+ }
127
+ ],
128
+ "special_tokens": {
129
+ "</s>": {
130
+ "id": "</s>",
131
+ "ids": [
132
+ 2
133
+ ],
134
+ "tokens": [
135
+ "</s>"
136
+ ]
137
+ }
138
+ }
139
+ },
140
+ "decoder": {
141
+ "type": "Metaspace",
142
+ "replacement": "\u2581",
143
+ "add_prefix_space": true
144
+ },
145
+ "model": {
146
+ "unk_id": 2,
147
+ "vocab": {
148
+ "<s>": 0,
149
+ "<pad>": 1,
150
+ "</s>": 2,
151
+ "<unk>": 3,
152
+ "\u2581": 4,
153
+ "e": 5,
154
+ "t": 6,
155
+ "a": 7,
156
+ "o": 8,
157
+ "n": 9,
158
+ "i": 10,
159
+ "h": 11,
160
+ "s": 12,
161
+ "r": 13,
162
+ "d": 14,
163
+ "l": 15,
164
+ "u": 16,
165
+ "c": 17,
166
+ "m": 18,
167
+ "f": 19,
168
+ "w": 20,
169
+ "g": 21,
170
+ "y": 22,
171
+ ",": 23,
172
+ "p": 24,
173
+ "b": 25,
174
+ ".": 26,
175
+ "v": 27,
176
+ "k": 28,
177
+ "\"": 29,
178
+ "I": 30,
179
+ "'": 31,
180
+ "T": 32,
181
+ "A": 33,
182
+ "S": 34,
183
+ "H": 35,
184
+ ";": 36,
185
+ "x": 37,
186
+ "W": 38,
187
+ "-": 39,
188
+ "B": 40,
189
+ "?": 41,
190
+ "C": 42,
191
+ "M": 43,
192
+ "!": 44,
193
+ "q": 45,
194
+ "j": 46,
195
+ "E": 47,
196
+ "N": 48,
197
+ "P": 49,
198
+ "O": 50,
199
+ "D": 51,
200
+ "L": 52,
201
+ "G": 53,
202
+ "R": 54,
203
+ "F": 55,
204
+ "Y": 56,
205
+ "z": 57,
206
+ "J": 58,
207
+ ":": 59,
208
+ "K": 60,
209
+ "U": 61,
210
+ "V": 62,
211
+ ")": 63,
212
+ "(": 64,
213
+ "Q": 65,
214
+ "Z": 66,
215
+ "]": 67,
216
+ "[": 68,
217
+ "X": 69,
218
+ "\u2014": 70,
219
+ "/": 71,
220
+ "\u00e6": 72,
221
+ "\u00e9": 73,
222
+ "{": 74,
223
+ "}": 75,
224
+ "\u00ea": 76,
225
+ "\u0153": 77,
226
+ "\u0304": 78,
227
+ "<mask>": 79,
228
+ "<ctc_blank>": 80
229
+ }
230
+ }
231
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "79": {
36
+ "content": "<mask>",
37
+ "lstrip": true,
38
+ "normalized": true,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "80": {
44
+ "content": "<ctc_blank>",
45
+ "lstrip": false,
46
+ "normalized": true,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": false
50
+ }
51
+ },
52
+ "bos_token": "<s>",
53
+ "clean_up_tokenization_spaces": true,
54
+ "eos_token": "</s>",
55
+ "mask_token": "<mask>",
56
+ "model_max_length": 600,
57
+ "normalize": false,
58
+ "pad_token": "<pad>",
59
+ "processor_class": "SpeechT5Processor",
60
+ "sp_model_kwargs": {},
61
+ "tokenizer_class": "SpeechT5Tokenizer",
62
+ "trust_remote_code": false,
63
+ "unk_token": "<unk>"
64
+ }