hf-transformers-bot commited on
Commit
3603f29
·
verified ·
1 Parent(s): 4e3d396

Update tiny models for GlmAsrForConditionalGeneration

Browse files
chat_template.jinja ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- macro to_text(content) -%}
2
+ {%- if content is string -%}
3
+ {{- content -}}
4
+ {%- elif content is iterable and content is not mapping -%}
5
+ {%- for item in content -%}
6
+ {%- if item is mapping and item.type == 'text' and item.text is defined -%}
7
+ {{- item.text -}}
8
+ {%- elif item is mapping and (item.type == 'audio' or 'audio' in item) -%}
9
+ <|begin_of_audio|><|pad|><|end_of_audio|><|user|>
10
+ {% elif item is string -%}
11
+ {{- item -}}
12
+ {%- endif -%}
13
+ {%- endfor -%}
14
+ {%- else -%}
15
+ {{- content -}}
16
+ {%- endif -%}
17
+ {%- endmacro -%}
18
+ {%- for m in messages -%}
19
+ {%- if m.role == 'system' -%}
20
+ <|system|>
21
+ {{ to_text(m.content) | trim }}
22
+ {%- elif m.role == 'user' -%}
23
+ <|user|>
24
+ {{ to_text(m.content) | trim }}
25
+ {%- elif m.role == 'assistant' -%}
26
+ <|assistant|>
27
+ {{ to_text(m.content) | trim }}
28
+ {%- endif -%}
29
+ {%- endfor -%}
30
+ {%- if add_generation_prompt -%}
31
+ <|assistant|>
32
+ {% endif -%}
config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "GlmAsrForConditionalGeneration"
4
+ ],
5
+ "audio_config": {
6
+ "attention_dropout": 0.0,
7
+ "hidden_act": "gelu",
8
+ "hidden_size": 32,
9
+ "initializer_range": 0.02,
10
+ "intermediate_size": 32,
11
+ "max_position_embeddings": 512,
12
+ "model_type": "glmasr_encoder",
13
+ "num_attention_heads": 2,
14
+ "num_hidden_layers": 2,
15
+ "num_key_value_heads": 2,
16
+ "num_mel_bins": 80,
17
+ "partial_rotary_factor": 0.5,
18
+ "rope_parameters": {
19
+ "partial_rotary_factor": 0.5,
20
+ "rope_theta": 10000.0,
21
+ "rope_type": "default"
22
+ }
23
+ },
24
+ "audio_token_id": 0,
25
+ "dtype": "float32",
26
+ "model_type": "glmasr",
27
+ "pad_token_id": 59246,
28
+ "projector_hidden_act": "gelu",
29
+ "text_config": {
30
+ "attention_bias": false,
31
+ "attention_dropout": 0.0,
32
+ "bos_token_id": 1,
33
+ "eos_token_id": 59246,
34
+ "head_dim": 8,
35
+ "hidden_act": "gelu",
36
+ "hidden_size": 32,
37
+ "initializer_range": 0.02,
38
+ "intermediate_size": 32,
39
+ "max_position_embeddings": 512,
40
+ "mlp_bias": false,
41
+ "model_type": "llama",
42
+ "num_attention_heads": 2,
43
+ "num_hidden_layers": 2,
44
+ "num_key_value_heads": 2,
45
+ "pad_token_id": 59246,
46
+ "pretraining_tp": 1,
47
+ "rms_norm_eps": 1e-06,
48
+ "rope_parameters": {
49
+ "rope_theta": 10000.0,
50
+ "rope_type": "default"
51
+ },
52
+ "tie_word_embeddings": false,
53
+ "use_cache": true,
54
+ "vocab_size": 59263
55
+ },
56
+ "tie_word_embeddings": true,
57
+ "transformers_version": "5.16.0.dev0"
58
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 59246,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "pad_token_id": 59246,
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:80328d9f9ff6b4033095caa8fb3fbff0bf79fa943c3c25413e2060330cba673c
3
+ size 7745560
preprocessor_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "chunk_length": 30,
3
+ "dither": 0.0,
4
+ "feature_extractor_type": "WhisperFeatureExtractor",
5
+ "feature_size": 128,
6
+ "hop_length": 160,
7
+ "n_fft": 400,
8
+ "n_samples": 480000,
9
+ "nb_max_frames": 3000,
10
+ "padding_side": "right",
11
+ "padding_value": 0.0,
12
+ "return_attention_mask": false,
13
+ "sampling_rate": 16000
14
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "clean_up_tokenization_spaces": false,
4
+ "do_lower_case": false,
5
+ "eos_token": "<|endoftext|>",
6
+ "extra_special_tokens": [
7
+ "<|endoftext|>",
8
+ "[MASK]",
9
+ "[gMASK]",
10
+ "[sMASK]",
11
+ "<sop>",
12
+ "<eop>",
13
+ "<|system|>",
14
+ "<|user|>",
15
+ "<|assistant|>",
16
+ "<|observation|>",
17
+ "<|begin_of_image|>",
18
+ "<|end_of_image|>",
19
+ "<|begin_of_video|>",
20
+ "<|end_of_video|>",
21
+ "<|pad|>",
22
+ "<|begin_of_audio|>",
23
+ "<|end_of_audio|>"
24
+ ],
25
+ "is_local": true,
26
+ "local_files_only": false,
27
+ "model_input_names": [
28
+ "input_ids",
29
+ "attention_mask"
30
+ ],
31
+ "model_max_length": 65536,
32
+ "model_specific_special_tokens": {},
33
+ "pad_token": "<|endoftext|>",
34
+ "padding_side": "left",
35
+ "processor_class": "GlmAsrProcessor",
36
+ "remove_space": false,
37
+ "tokenizer_class": "TokenizersBackend"
38
+ }