commandeaw commited on
Commit
28ec8a1
·
verified ·
1 Parent(s): 5b6e26c

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: k2-fsa/OmniVoice
4
+ library_name: mlx-audio
5
+ pipeline_tag: text-to-speech
6
+ tags:
7
+ - mlx
8
+ - text-to-speech
9
+ - voice-cloning
10
+ ---
11
+
12
+ # OmniVoice MLX (4bit)
13
+
14
+ [k2-fsa/OmniVoice](https://huggingface.co/k2-fsa/OmniVoice) converted to
15
+ MLX (4bit) for [mlx-audio](https://github.com/Blaizzy/mlx-audio) on
16
+ Apple Silicon.
17
+
18
+ Just a format conversion — a complete one: the HiggsAudio semantic
19
+ tokenizer weights are kept, so zero-shot voice cloning works.
audio_tokenizer/config.json ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "acoustic_model_config": {
3
+ "codebook_dim": 8,
4
+ "codebook_loss_weight": 1.0,
5
+ "codebook_size": 1024,
6
+ "commitment_loss_weight": 0.25,
7
+ "decoder_hidden_size": 1024,
8
+ "downsampling_ratios": [
9
+ 8,
10
+ 5,
11
+ 4,
12
+ 2,
13
+ 3
14
+ ],
15
+ "encoder_hidden_size": 64,
16
+ "hidden_size": 256,
17
+ "hop_length": 960,
18
+ "model_type": "dac",
19
+ "n_codebooks": 9,
20
+ "quantizer_dropout": 0,
21
+ "sampling_rate": 16000,
22
+ "upsampling_ratios": [
23
+ 8,
24
+ 5,
25
+ 4,
26
+ 2,
27
+ 3
28
+ ]
29
+ },
30
+ "architectures": [
31
+ "HiggsAudioV2TokenizerModel"
32
+ ],
33
+ "block_dilations": [
34
+ 1,
35
+ 1
36
+ ],
37
+ "channel_ratios": [
38
+ 1,
39
+ 1
40
+ ],
41
+ "codebook_dim": 64,
42
+ "codebook_size": 1024,
43
+ "downsample_factor": 320,
44
+ "dtype": "float32",
45
+ "initializer_range": 0.02,
46
+ "kernel_size": 3,
47
+ "model_type": "higgs_audio_v2_tokenizer",
48
+ "sample_rate": 24000,
49
+ "semantic_model_config": {
50
+ "activation_dropout": 0.1,
51
+ "apply_spec_augment": true,
52
+ "attention_dropout": 0.1,
53
+ "bos_token_id": 1,
54
+ "classifier_proj_size": 256,
55
+ "conv_bias": false,
56
+ "conv_dim": [
57
+ 512,
58
+ 512,
59
+ 512,
60
+ 512,
61
+ 512,
62
+ 512,
63
+ 512
64
+ ],
65
+ "conv_kernel": [
66
+ 10,
67
+ 3,
68
+ 3,
69
+ 3,
70
+ 3,
71
+ 2,
72
+ 2
73
+ ],
74
+ "conv_pos_batch_norm": false,
75
+ "conv_stride": [
76
+ 5,
77
+ 2,
78
+ 2,
79
+ 2,
80
+ 2,
81
+ 2,
82
+ 2
83
+ ],
84
+ "ctc_loss_reduction": "sum",
85
+ "ctc_zero_infinity": false,
86
+ "do_stable_layer_norm": false,
87
+ "eos_token_id": 2,
88
+ "feat_extract_activation": "gelu",
89
+ "feat_extract_norm": "group",
90
+ "feat_proj_dropout": 0.0,
91
+ "feat_proj_layer_norm": true,
92
+ "final_dropout": 0.1,
93
+ "hidden_act": "gelu",
94
+ "hidden_dropout": 0.1,
95
+ "hidden_size": 768,
96
+ "initializer_range": 0.02,
97
+ "intermediate_size": 3072,
98
+ "layer_norm_eps": 1e-05,
99
+ "layerdrop": 0.1,
100
+ "mask_feature_length": 10,
101
+ "mask_feature_min_masks": 0,
102
+ "mask_feature_prob": 0.0,
103
+ "mask_time_length": 10,
104
+ "mask_time_min_masks": 2,
105
+ "mask_time_prob": 0.0,
106
+ "model_type": "hubert",
107
+ "num_attention_heads": 12,
108
+ "num_conv_pos_embedding_groups": 16,
109
+ "num_conv_pos_embeddings": 128,
110
+ "num_feat_extract_layers": 7,
111
+ "num_hidden_layers": 12,
112
+ "pad_token_id": 0,
113
+ "use_weighted_layer_sum": false,
114
+ "vocab_size": 32
115
+ },
116
+ "semantic_sample_rate": 16000,
117
+ "strides": [
118
+ 1,
119
+ 1
120
+ ],
121
+ "target_bandwidths": [
122
+ 0.5,
123
+ 1,
124
+ 1.5,
125
+ 2
126
+ ],
127
+ "transformers_version": "5.3.0.dev0",
128
+ "unit_kernel_size": 3
129
+ }
audio_tokenizer/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e174ff32bc3e07520bf48594b7262713adaa05ed6e99926accbc504c59b47e4
3
+ size 402864930
audio_tokenizer/preprocessor_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "feature_extractor_type": "DacFeatureExtractor",
3
+ "feature_size": 1,
4
+ "hop_length": 960,
5
+ "padding_side": "right",
6
+ "padding_value": 0.0,
7
+ "return_attention_mask": true,
8
+ "sampling_rate": 24000
9
+ }
chat_template.jinja ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n\n' }}
5
+ {%- endif %}
6
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
7
+ {%- for tool in tools %}
8
+ {{- "\n" }}
9
+ {{- tool | tojson }}
10
+ {%- endfor %}
11
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
12
+ {%- else %}
13
+ {%- if messages[0].role == 'system' %}
14
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
18
+ {%- for message in messages[::-1] %}
19
+ {%- set index = (messages|length - 1) - loop.index0 %}
20
+ {%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
21
+ {%- set ns.multi_step_tool = false %}
22
+ {%- set ns.last_query_index = index %}
23
+ {%- endif %}
24
+ {%- endfor %}
25
+ {%- for message in messages %}
26
+ {%- if message.content is string %}
27
+ {%- set content = message.content %}
28
+ {%- else %}
29
+ {%- set content = '' %}
30
+ {%- endif %}
31
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
32
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
33
+ {%- elif message.role == "assistant" %}
34
+ {%- set reasoning_content = '' %}
35
+ {%- if message.reasoning_content is string %}
36
+ {%- set reasoning_content = message.reasoning_content %}
37
+ {%- else %}
38
+ {%- if '</think>' in content %}
39
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
40
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
41
+ {%- endif %}
42
+ {%- endif %}
43
+ {%- if loop.index0 > ns.last_query_index %}
44
+ {%- if loop.last or (not loop.last and reasoning_content) %}
45
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
46
+ {%- else %}
47
+ {{- '<|im_start|>' + message.role + '\n' + content }}
48
+ {%- endif %}
49
+ {%- else %}
50
+ {{- '<|im_start|>' + message.role + '\n' + content }}
51
+ {%- endif %}
52
+ {%- if message.tool_calls %}
53
+ {%- for tool_call in message.tool_calls %}
54
+ {%- if (loop.first and content) or (not loop.first) %}
55
+ {{- '\n' }}
56
+ {%- endif %}
57
+ {%- if tool_call.function %}
58
+ {%- set tool_call = tool_call.function %}
59
+ {%- endif %}
60
+ {{- '<tool_call>\n{"name": "' }}
61
+ {{- tool_call.name }}
62
+ {{- '", "arguments": ' }}
63
+ {%- if tool_call.arguments is string %}
64
+ {{- tool_call.arguments }}
65
+ {%- else %}
66
+ {{- tool_call.arguments | tojson }}
67
+ {%- endif %}
68
+ {{- '}\n</tool_call>' }}
69
+ {%- endfor %}
70
+ {%- endif %}
71
+ {{- '<|im_end|>\n' }}
72
+ {%- elif message.role == "tool" %}
73
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
74
+ {{- '<|im_start|>user' }}
75
+ {%- endif %}
76
+ {{- '\n<tool_response>\n' }}
77
+ {{- content }}
78
+ {{- '\n</tool_response>' }}
79
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
80
+ {{- '<|im_end|>\n' }}
81
+ {%- endif %}
82
+ {%- endif %}
83
+ {%- endfor %}
84
+ {%- if add_generation_prompt %}
85
+ {{- '<|im_start|>assistant\n' }}
86
+ {%- if enable_thinking is defined and enable_thinking is false %}
87
+ {{- '<think>\n\n</think>\n\n' }}
88
+ {%- endif %}
89
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "OmniVoice"
4
+ ],
5
+ "audio_codebook_weights": [
6
+ 8,
7
+ 8,
8
+ 6,
9
+ 6,
10
+ 4,
11
+ 4,
12
+ 2,
13
+ 2
14
+ ],
15
+ "audio_mask_id": 1024,
16
+ "audio_vocab_size": 1025,
17
+ "bos_token_id": null,
18
+ "dtype": "bfloat16",
19
+ "eos_token_id": 151645,
20
+ "llm_config": {
21
+ "_name_or_path": "",
22
+ "architectures": [
23
+ "Qwen3ForCausalLM"
24
+ ],
25
+ "attention_bias": false,
26
+ "attention_dropout": 0.0,
27
+ "bos_token_id": 151643,
28
+ "chunk_size_feed_forward": 0,
29
+ "dtype": "float32",
30
+ "eos_token_id": 151645,
31
+ "head_dim": 128,
32
+ "hidden_act": "silu",
33
+ "hidden_size": 1024,
34
+ "id2label": {
35
+ "0": "LABEL_0",
36
+ "1": "LABEL_1"
37
+ },
38
+ "initializer_range": 0.02,
39
+ "intermediate_size": 3072,
40
+ "is_encoder_decoder": false,
41
+ "label2id": {
42
+ "LABEL_0": 0,
43
+ "LABEL_1": 1
44
+ },
45
+ "layer_types": [
46
+ "full_attention",
47
+ "full_attention",
48
+ "full_attention",
49
+ "full_attention",
50
+ "full_attention",
51
+ "full_attention",
52
+ "full_attention",
53
+ "full_attention",
54
+ "full_attention",
55
+ "full_attention",
56
+ "full_attention",
57
+ "full_attention",
58
+ "full_attention",
59
+ "full_attention",
60
+ "full_attention",
61
+ "full_attention",
62
+ "full_attention",
63
+ "full_attention",
64
+ "full_attention",
65
+ "full_attention",
66
+ "full_attention",
67
+ "full_attention",
68
+ "full_attention",
69
+ "full_attention",
70
+ "full_attention",
71
+ "full_attention",
72
+ "full_attention",
73
+ "full_attention"
74
+ ],
75
+ "max_position_embeddings": 40960,
76
+ "max_window_layers": 28,
77
+ "model_type": "qwen3",
78
+ "num_attention_heads": 16,
79
+ "num_hidden_layers": 28,
80
+ "num_key_value_heads": 8,
81
+ "output_attentions": false,
82
+ "output_hidden_states": false,
83
+ "pad_token_id": null,
84
+ "problem_type": null,
85
+ "return_dict": true,
86
+ "rms_norm_eps": 1e-06,
87
+ "rope_parameters": {
88
+ "rope_theta": 1000000,
89
+ "rope_type": "default"
90
+ },
91
+ "sliding_window": null,
92
+ "tie_word_embeddings": true,
93
+ "use_cache": true,
94
+ "use_sliding_window": false,
95
+ "vocab_size": 151676
96
+ },
97
+ "model_type": "omnivoice",
98
+ "num_audio_codebook": 8,
99
+ "pad_token_id": 151643,
100
+ "transformers_version": "5.3.0",
101
+ "quantization": {
102
+ "group_size": 64,
103
+ "bits": 4
104
+ }
105
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:526480a79a0fa4ac065f69163437226032c39100bad822056802dc13abc239b0
3
+ size 344753910
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:408f669b7e2b045fdf54201d815bd364e6667dbd845115da81239c40bc6dcfd1
3
+ size 11423986
tokenizer_config.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|denoise|>",
10
+ "<|lang_start|>",
11
+ "<|lang_end|>",
12
+ "<|instruct_start|>",
13
+ "<|instruct_end|>",
14
+ "<|text_start|>",
15
+ "<|text_end|>"
16
+ ],
17
+ "is_local": true,
18
+ "model_max_length": 131072,
19
+ "pad_token": "<|endoftext|>",
20
+ "split_special_tokens": false,
21
+ "tokenizer_class": "Qwen2Tokenizer",
22
+ "unk_token": null
23
+ }