hf-transformers-bot commited on
Commit
76bd627
·
verified ·
1 Parent(s): fe18c8f

Update tiny models for HyperCLOVAXModel

Browse files
Files changed (5) hide show
  1. chat_template.jinja +108 -0
  2. config.json +36 -0
  3. model.safetensors +3 -0
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +13 -0
chat_template.jinja ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% if tools is not defined or tools is none %}
2
+ {{- '<|im_start|>tool_list\n<|im_end|>\n' }}
3
+ {%- else %}
4
+ {{- '<|im_start|>tool_list\n[' }}
5
+ {%- for tool in tools %}
6
+ {{- '{"name": "' }}
7
+ {{- tool.function.name }}
8
+ {{- '", ' }}
9
+ {{- '"description": "' }}
10
+ {{- tool.function.description }}
11
+ {{- '"' }}
12
+ {%- if tool.function.parameters is defined %}
13
+ {{- ', "parameters": ' }}
14
+ {{- tool.function.parameters | tojson }}
15
+ {%- endif %}
16
+ {{- '}' }}
17
+ {%- if not loop.last %}
18
+ {{- ', ' }}
19
+ {%- endif %}
20
+ {%- endfor %}
21
+ {{- ']<|im_end|>\n' }}
22
+ {%- endif %}
23
+
24
+ {%- set ns = namespace(is_searching=true, last_query_index=-1) %}
25
+ {%- for message in messages[::-1] %}
26
+ {%- set index = (messages|length - 1) - loop.index0 %}
27
+ {%- if ns.is_searching and (message.role == 'user' or message.role == 'tool') %}
28
+ {%- set ns.last_query_index = index %}
29
+ {%- set ns.is_searching = false %}
30
+ {%- endif %}
31
+ {%- endfor %}
32
+
33
+ {%- for message in messages %}
34
+ {%- if loop.index0 == 0 and message.role != 'system' %}
35
+ {{- '<|im_start|>system\n<|im_end|>\n' }}
36
+ {%- endif %}
37
+
38
+ {%- if message.content is string %}
39
+ {%- set content = message.content %}
40
+ {%- elif message.content is iterable and message.content is not none %}
41
+ {%- set ns_content = namespace(text='') %}
42
+ {%- for part in message.content %}
43
+ {%- if part.type is defined and part.type == 'text' and part.text is defined %}
44
+ {%- set ns_content.text = ns_content.text + part.text %}
45
+ {%- endif %}
46
+ {%- endfor %}
47
+ {%- set content = ns_content.text %}
48
+ {%- else %}
49
+ {%- set content = '' %}
50
+ {%- endif %}
51
+
52
+ {%- set reasoning_content = '' %}
53
+ {%- if message.reasoning_content is defined and message.reasoning_content is not none %}
54
+ {%- set reasoning_content = message.reasoning_content %}
55
+ {%- endif %}
56
+ {%- if message.role == "assistant" %}
57
+ {%- if loop.index0 > ns.last_query_index %}
58
+ {%- if reasoning_content %}
59
+ {{- '<|im_start|>assistant/think\n' + reasoning_content.strip('\n') + '<|im_end|>\n' }}
60
+ {%- endif %}
61
+ {%- endif %}
62
+
63
+ {%- if content %}
64
+ {{- '<|im_start|>assistant\n' + content.strip('\n') + '<|im_end|>' }}
65
+ {%- if message.tool_calls %}
66
+ {{- '\n' }}
67
+ {%- else %}
68
+ {{- '<|endofturn|>\n' }}
69
+ {%- endif %}
70
+ {%- endif %}
71
+
72
+ {%- if message.tool_calls %}
73
+ {{- '<|im_start|>assistant -> tool/function_call\n[' }}
74
+ {%- for tool_call in message.tool_calls %}
75
+ {%- if not loop.first %}
76
+ {{- ', ' }}
77
+ {%- endif %}
78
+ {%- if tool_call.function %}
79
+ {%- set tool_call = tool_call.function %}
80
+ {%- endif %}
81
+ {{- '{"name": "' }}
82
+ {{- tool_call.name }}
83
+ {{- '", "arguments": ' }}
84
+ {%- if tool_call.arguments is string %}
85
+ {{- tool_call.arguments }}
86
+ {%- else %}
87
+ {{- tool_call.arguments | tojson }}
88
+ {%- endif %}
89
+ {{- '}' }}
90
+ {%- endfor %}
91
+ {{- ']<|im_end|><|stop|>\n' }}
92
+
93
+ {%- endif %}
94
+ {%- elif message.role == "tool" %}
95
+ {{- '<|im_start|>tool/function_call\n' + content + '<|im_end|>\n' }}
96
+ {%- else %}
97
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>\n' }}
98
+ {%- endif %}
99
+ {%- endfor %}
100
+ {%- if add_generation_prompt %}
101
+ {%- if force_reasoning is defined and force_reasoning is true %}
102
+ {{- '<|im_start|>assistant/think\n' }}
103
+ {%- elif skip_reasoning is defined and skip_reasoning is true %}
104
+ {{- '<|im_start|>assistant/think\n<|im_end|>\n<|im_start|>assistant\n' }}
105
+ {%- else %}
106
+ {{- '<|im_start|>assistant' }}
107
+ {%- endif %}
108
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "HyperCLOVAXModel"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "attention_multiplier": 0.25,
8
+ "bos_token_id": 100257,
9
+ "dtype": "float32",
10
+ "embedding_multiplier": 1.0,
11
+ "eos_token_id": 100257,
12
+ "head_dim": 16,
13
+ "hidden_act": "gelu",
14
+ "hidden_size": 32,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 32,
17
+ "logits_scaling": 1.0,
18
+ "max_position_embeddings": 512,
19
+ "mlp_bias": false,
20
+ "model_type": "hyperclovax",
21
+ "num_attention_heads": 2,
22
+ "num_hidden_layers": 2,
23
+ "num_key_value_heads": 2,
24
+ "pad_token_id": 100257,
25
+ "residual_multiplier": 1.0,
26
+ "rms_norm_eps": 1e-06,
27
+ "rope_parameters": {
28
+ "rope_theta": 10000.0,
29
+ "rope_type": "default"
30
+ },
31
+ "tie_word_embeddings": false,
32
+ "transformers_version": "5.16.0.dev0",
33
+ "use_cache": true,
34
+ "use_post_norm": true,
35
+ "vocab_size": 110524
36
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0c94f79b52ef4d37c67bc5cdd9c8812e4010296b51ffefa1ea2b23d4886dc0c
3
+ size 14207960
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|endoftext|>",
5
+ "clean_up_tokenization_spaces": true,
6
+ "eos_token": "<|endoftext|>",
7
+ "is_local": true,
8
+ "local_files_only": false,
9
+ "model_max_length": 512,
10
+ "pad_token": "<|endoftext|>",
11
+ "tokenizer_class": "TokenizersBackend",
12
+ "unk_token": "<|endoftext|>"
13
+ }