hf-transformers-bot commited on
Commit
93901d1
·
verified ·
1 Parent(s): ac35367

Update tiny models for HiggsAudioV2ForConditionalGeneration

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
chat_template.jinja ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {#- This block extracts the system message, so we can slot it into the right place. #}
3
+ {%- if messages[0]['role'] == 'system' %}
4
+ {%- if messages[0]['content'] is string %}
5
+ {%- set system_message = messages[0]['content']|trim %}
6
+ {%- elif messages[0]['content'] is iterable and messages[0]['content'][0]['type'] == 'text' %}
7
+ {%- set system_message = messages[0]['content'][0]['text']|trim %}
8
+ {%- else %}
9
+ {{- raise_exception("System message content must be a string or contain text type!") }}
10
+ {%- endif %}
11
+ {%- set messages = messages[1:] %}
12
+ {%- else %}
13
+ {{- raise_exception("A system message is required but not provided!") }}
14
+ {%- endif %}
15
+
16
+ {#- System message #}
17
+ {{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
18
+ {{- system_message }}
19
+
20
+ {#- Check for scene message and handle it specially #}
21
+ {%- if messages and messages[0]['role'] == 'scene' %}
22
+ {{- "\n\n<|scene_desc_start|>\n" }}
23
+ {%- if messages[0]['content'] is string %}
24
+ {{- messages[0]['content'] | trim }}
25
+ {%- elif messages[0]['content'] is iterable %}
26
+ {%- for content_item in messages[0]['content'] %}
27
+ {%- if content_item['type'] == 'text' %}
28
+ {%- set text_content = content_item['text'] | trim %}
29
+ {{- text_content }}
30
+ {%- if loop.first and not loop.last %}
31
+ {{- "\n\n" }}
32
+ {%- endif %}
33
+ {%- if not loop.first and not loop.last and messages[0]['content'][loop.index]['type'] != 'audio' %}
34
+ {{- "\n" }}
35
+ {%- endif %}
36
+ {%- elif content_item['type'] == 'audio' %}
37
+ {{- ' <|audio_out_bos|><|AUDIO_OUT|><|audio_eos|>' }}
38
+ {%- if not loop.last %}
39
+ {{- "\n" }}
40
+ {%- endif %}
41
+ {%- endif %}
42
+ {%- endfor %}
43
+ {%- endif %}
44
+ {{- "\n<|scene_desc_end|>" }}
45
+ {%- set messages = messages[1:] %}
46
+ {%- endif %}
47
+
48
+ {{- "<|eot_id|>" }}
49
+
50
+ {#- Loop through all messages #}
51
+ {%- for message in messages %}
52
+ {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n' }}
53
+ {%- if message['role'] == 'assistant' %}
54
+ {%- if message['content'] is not iterable or message['content'][0]['type'] != 'audio' %}
55
+ {{- raise_exception("Assistant messages must contain audio content only!") }}
56
+ {%- endif %}
57
+ {{- '<|audio_out_bos|><|AUDIO_OUT|><|audio_eos|>' }}
58
+ {%- else %}
59
+ {%- if message['content'] is string %}
60
+ {{- message['content'] | trim }}
61
+ {%- elif message['content'] is iterable %}
62
+ {%- for content_item in message['content'] %}
63
+ {%- if content_item['type'] == 'text' %}
64
+ {{- content_item['text'] | trim }}
65
+ {%- endif %}
66
+ {%- endfor %}
67
+ {%- endif %}
68
+ {%- endif %}
69
+ {{- '<|eot_id|>' }}
70
+ {%- endfor %}
71
+
72
+ {%- if add_generation_prompt %}
73
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n<|audio_out_bos|>' }}
74
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "HiggsAudioV2ForConditionalGeneration"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "audio_bos_token_id": 128254,
8
+ "audio_delay_token_id": 128253,
9
+ "audio_stream_bos_id": 15,
10
+ "audio_stream_eos_id": 14,
11
+ "audio_token_id": 128255,
12
+ "bos_token_id": 128000,
13
+ "codebook_size": 16,
14
+ "dtype": "float32",
15
+ "eos_token_id": 128001,
16
+ "head_dim": 16,
17
+ "hidden_act": "silu",
18
+ "hidden_size": 32,
19
+ "initializer_range": 0.02,
20
+ "intermediate_size": 37,
21
+ "max_position_embeddings": 512,
22
+ "mlp_bias": false,
23
+ "model_type": "higgs_audio_v2",
24
+ "num_attention_heads": 2,
25
+ "num_codebooks": 2,
26
+ "num_hidden_layers": 2,
27
+ "num_key_value_heads": 2,
28
+ "pad_token_id": 128001,
29
+ "pretraining_tp": 1,
30
+ "rms_norm_eps": 1e-05,
31
+ "rope_parameters": {
32
+ "factor": 32.0,
33
+ "high_freq_factor": 4.0,
34
+ "low_freq_factor": 1.0,
35
+ "original_max_position_embeddings": 8192,
36
+ "rope_theta": 500000.0,
37
+ "rope_type": "llama3"
38
+ },
39
+ "tie_word_embeddings": false,
40
+ "transformers_version": "5.16.0.dev0",
41
+ "use_cache": true,
42
+ "vocab_size": 128256
43
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 128000,
4
+ "eos_token_id": 128001,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "pad_token_id": 128001,
8
+ "transformers_version": "5.16.0.dev0",
9
+ "use_cache": true
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1ce2743f666a5c3c5eeff2e87a1ee82de3e2818bf96e65cde80e7be3c347d05
3
+ size 16519168
preprocessor_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "feature_extractor_type": "DacFeatureExtractor",
3
+ "feature_size": 1,
4
+ "hop_length": 1,
5
+ "padding_side": "right",
6
+ "padding_value": 0.0,
7
+ "return_attention_mask": true,
8
+ "sampling_rate": 24000
9
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a222563314bf6ffe3471622bff017ff5bb0630f2924faf44216195ebfef2af3
3
+ size 17209675
tokenizer_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|end_of_text|>",
6
+ "is_local": true,
7
+ "local_files_only": false,
8
+ "model_input_names": [
9
+ "input_ids",
10
+ "attention_mask"
11
+ ],
12
+ "model_max_length": 512,
13
+ "pad_token": "<|end_of_text|>",
14
+ "processor_class": "HiggsAudioV2Processor",
15
+ "tokenizer_class": "TokenizersBackend",
16
+ "trust_remote": true
17
+ }