florentgbelidji HF Staff commited on
Commit
c8fb204
·
verified ·
1 Parent(s): 6fb49ef

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
chat_template.jinja ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {%- if custom_tools is defined and custom_tools%}
3
+ {%- set tools = custom_tools %}
4
+ {%- endif %}
5
+ {%- if tools is defined and tools %}
6
+ {%- set tool_definition = tool_definition ~ (tools | tojson(indent=4)) %}
7
+ {%- else %}
8
+ {%- set tools = none %}
9
+ {%- endif %}
10
+
11
+
12
+ {#- This block extracts the system message, so we can slot it into the right place. #}
13
+ {%- if messages[0]['role'] == 'system' %}
14
+ {%- set user_provided_system_message = true %}
15
+ {%- if messages[0]['content'] is string %}
16
+ {%- set system_message = messages[0]['content']|trim %}
17
+ {%- else %}
18
+ {%- set system_message = messages[0]['content'][0]['text']|trim %}
19
+ {%- endif %}
20
+ {%- set messages = messages[1:] %}
21
+ {%- else %}
22
+ {%- if tools is not none %}
23
+ {#- Since not system_message was provided by user, if tool is provided, system_message is now default tool system message #}
24
+ {#- This system message is from llama website:https://www.llama.com/docs/model-cards-and-prompt-formats/llama4/ #}
25
+ {%- set system_message = "You are a helpful assistant and an expert in function composition. You can answer general questions using your internal knowledge OR invoke functions when necessary. Follow these strict guidelines:\n\n1. FUNCTION CALLS:\n- ONLY use functions that are EXPLICITLY listed in the function list below\n- If NO functions are listed (empty function list []), respond ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\"\n- If a function is not in the list, respond ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\"\n- If ALL required parameters are present AND the query EXACTLY matches a listed function's purpose: output ONLY the function call(s)\n- Use exact format: [func_name1(param1=value1, param2=value2), func_name2(...)]\nExamples:\nCORRECT: [get_weather(location=\"Vancouver\"), calculate_route(start=\"Boston\", end=\"New York\")] <- Only if get_weather and calculate_route are in function list\nINCORRECT: get_weather(location=\"New York\")\nINCORRECT: Let me check the weather: [get_weather(location=\"New York\")]\nINCORRECT: [get_events(location=\"Singapore\")] <- If function not in list\n\n2. RESPONSE RULES:\n- For pure function requests matching a listed function: ONLY output the function call(s)\n- For knowledge questions: ONLY output text\n- For missing parameters: ONLY request the specific missing parameters\n- For unavailable services (not in function list): output ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\". Do NOT execute a function call.\n- If the query asks for information beyond what a listed function provides: output ONLY with internal knowledge about your limitations\n- NEVER combine text and function calls in the same response\n- NEVER suggest alternative functions when the requested service is unavailable\n- NEVER create or invent new functions not listed below\n\n3. STRICT BOUNDARIES:\n- ONLY use functions from the list below - no exceptions\n- NEVER use a function as an alternative to unavailable information\n- NEVER call functions not present in the function list\n- NEVER add explanatory text to function calls\n- NEVER respond with empty brackets\n- Use proper Python/JSON syntax for function calls\n- Check the function list carefully before responding\n\n4. TOOL RESPONSE HANDLING:\n- When receiving tool responses: provide concise, natural language responses\n- Don't repeat tool response verbatim\n- Don't add supplementary information\n\nHere is a list of functions in JSON format that you can invoke:\n" %}
26
+ {%- else %}
27
+ {%- set system_message = "" %}
28
+ {%- endif %}
29
+ {%- endif %}
30
+ {#- Now writing the system message: use the user provided system message if user_provided_system_message, else default tool system message if tools presented #}
31
+ {%- if system_message %}
32
+ {#- always use user provided system message to override default tool system message #}
33
+ {{- "<|header_start|>system<|header_end|>\n\n" }}
34
+ {{- system_message }}
35
+ {%- if user_provided_system_message and tools %}
36
+ {{- "\nHere is a list of functions in JSON format that you can invoke. Use exact format: [func_name1(param1=value1, param2=value2), func_name2(...)]\n" }}
37
+ {{- tool_definition -}}
38
+ {%- elif tool_definition %}
39
+ {{- tool_definition -}}
40
+ {%- endif %}
41
+ {{- "<|eot|>" }}
42
+ {%- endif %}
43
+
44
+ {#- Now deal with all other messages #}
45
+ {%- for message in messages %}
46
+ {#- Base case: messages that are not from tool role and has empty tool_call list #}
47
+ {%- if not (message.role == 'ipython' or message.role == 'tool' or ('tool_calls' in message and message.tool_calls|length != 0 )) %}
48
+ {{- '<|header_start|>' + message['role'] + '<|header_end|>\n\n' }}
49
+ {%- if message['content'] is string %}
50
+ {{- message['content'] }}
51
+ {%- else %}
52
+ {%- for content in message['content'] %}
53
+ {%- if content['type'] == 'image' %}
54
+ {{- '<|image|>' }}
55
+ {%- elif content['type'] == 'text' %}
56
+ {{- content['text'] | trim }}
57
+ {%- endif %}
58
+ {%- endfor %}
59
+ {%- endif %}
60
+ {{- "<|eot|>" }}
61
+ {#- Tool case: messages has non-empty tool_call list, must from assistant #}
62
+ {%- elif 'tool_calls' in message %}
63
+ {#- assume tool_calls are always coming from assistant #}
64
+ {%- if message.role == 'assistant' %}
65
+ {{- '<|header_start|>assistant<|header_end|>\n\n' -}}
66
+ {%- if message['content'] is string %}
67
+ {{- message['content'] }}
68
+ {%- else %}
69
+ {%- for content in message['content'] %}
70
+ {%- if content['type'] == 'image' %}
71
+ {{- '<|image|>' }}
72
+ {%- elif content['type'] == 'text' %}
73
+ {{- content['text'] }}
74
+ {%- endif %}
75
+ {%- endfor %}
76
+ {%- endif %}
77
+ {{- "[" }}
78
+ {%- for tool_call in message.tool_calls %}
79
+ {%- if tool_call.function is defined %}
80
+ {%- set tool_call = tool_call.function %}
81
+ {%- endif %}
82
+ {{- tool_call.name + '(' -}}
83
+ {%- for param in tool_call.arguments %}
84
+ {{- param + '="' -}}
85
+ {{- "%s" | format(tool_call.arguments[param]) -}}
86
+ {{- '"' -}}
87
+ {% if not loop.last %}, {% endif %}
88
+ {%- endfor %}
89
+ {{- ')' -}}
90
+ {% if not loop.last %}, {% endif %}
91
+ {%- endfor %}
92
+ {{- "]<|eot|>" }}
93
+ {%- endif %}
94
+ {#- Tool_response case: messages are from tool_response #}
95
+ {%- elif message.role == "tool" or message.role == "ipython" %}
96
+ {{- "<|header_start|>ipython<|header_end|>\n\n" }}
97
+ {%- if message.content is string %}
98
+ {{- message.content | tojson }}
99
+ {%- else %}
100
+ {%- for content in message['content'] %}
101
+ {%- if content['type'] == 'text' %}
102
+ {{- content['text'] | tojson }}
103
+ {%- endif %}
104
+ {%- endfor %}
105
+ {%- endif %}
106
+ {{- "<|eot|>" }}
107
+ {%- endif %}
108
+ {%- endfor %}
109
+ {%- if add_generation_prompt %}
110
+ {{- '<|header_start|>assistant<|header_end|>\n\n' }}
111
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_attn_implementation_autoset": true,
3
+ "attention_bias": false,
4
+ "attention_chunk_size": 8192,
5
+ "attention_dropout": 0.0,
6
+ "attn_scale": 0.1,
7
+ "attn_temperature_tuning": true,
8
+ "bos_token_id": 200000,
9
+ "dtype": "bfloat16",
10
+ "eos_token_id": [
11
+ 200001,
12
+ 200007,
13
+ 200008
14
+ ],
15
+ "floor_scale": 8192,
16
+ "for_llm_compressor": false,
17
+ "head_dim": 128,
18
+ "hidden_act": "silu",
19
+ "hidden_size": 5120,
20
+ "initializer_range": 0.02,
21
+ "interleave_moe_layer_step": 1,
22
+ "intermediate_size": 8192,
23
+ "intermediate_size_mlp": 16384,
24
+ "layer_types": [
25
+ "chunked_attention",
26
+ "chunked_attention",
27
+ "chunked_attention",
28
+ "full_attention",
29
+ "chunked_attention",
30
+ "chunked_attention",
31
+ "chunked_attention",
32
+ "full_attention",
33
+ "chunked_attention",
34
+ "chunked_attention",
35
+ "chunked_attention",
36
+ "full_attention",
37
+ "chunked_attention",
38
+ "chunked_attention",
39
+ "chunked_attention",
40
+ "full_attention",
41
+ "chunked_attention",
42
+ "chunked_attention",
43
+ "chunked_attention",
44
+ "full_attention",
45
+ "chunked_attention",
46
+ "chunked_attention",
47
+ "chunked_attention",
48
+ "full_attention",
49
+ "chunked_attention",
50
+ "chunked_attention",
51
+ "chunked_attention",
52
+ "full_attention",
53
+ "chunked_attention",
54
+ "chunked_attention",
55
+ "chunked_attention",
56
+ "full_attention",
57
+ "chunked_attention",
58
+ "chunked_attention",
59
+ "chunked_attention",
60
+ "full_attention",
61
+ "chunked_attention",
62
+ "chunked_attention",
63
+ "chunked_attention",
64
+ "full_attention",
65
+ "chunked_attention",
66
+ "chunked_attention",
67
+ "chunked_attention",
68
+ "full_attention",
69
+ "chunked_attention",
70
+ "chunked_attention",
71
+ "chunked_attention",
72
+ "full_attention"
73
+ ],
74
+ "max_position_embeddings": 10485760,
75
+ "model_type": "llama4_text",
76
+ "moe_layers": [
77
+ 0,
78
+ 1,
79
+ 2,
80
+ 3,
81
+ 4,
82
+ 5,
83
+ 6,
84
+ 7,
85
+ 8,
86
+ 9,
87
+ 10,
88
+ 11,
89
+ 12,
90
+ 13,
91
+ 14,
92
+ 15,
93
+ 16,
94
+ 17,
95
+ 18,
96
+ 19,
97
+ 20,
98
+ 21,
99
+ 22,
100
+ 23,
101
+ 24,
102
+ 25,
103
+ 26,
104
+ 27,
105
+ 28,
106
+ 29,
107
+ 30,
108
+ 31,
109
+ 32,
110
+ 33,
111
+ 34,
112
+ 35,
113
+ 36,
114
+ 37,
115
+ 38,
116
+ 39,
117
+ 40,
118
+ 41,
119
+ 42,
120
+ 43,
121
+ 44,
122
+ 45,
123
+ 46,
124
+ 47
125
+ ],
126
+ "no_rope_layers": [
127
+ 1,
128
+ 1,
129
+ 1,
130
+ 0,
131
+ 1,
132
+ 1,
133
+ 1,
134
+ 0,
135
+ 1,
136
+ 1,
137
+ 1,
138
+ 0,
139
+ 1,
140
+ 1,
141
+ 1,
142
+ 0,
143
+ 1,
144
+ 1,
145
+ 1,
146
+ 0,
147
+ 1,
148
+ 1,
149
+ 1,
150
+ 0,
151
+ 1,
152
+ 1,
153
+ 1,
154
+ 0,
155
+ 1,
156
+ 1,
157
+ 1,
158
+ 0,
159
+ 1,
160
+ 1,
161
+ 1,
162
+ 0,
163
+ 1,
164
+ 1,
165
+ 1,
166
+ 0,
167
+ 1,
168
+ 1,
169
+ 1,
170
+ 0,
171
+ 1,
172
+ 1,
173
+ 1,
174
+ 0
175
+ ],
176
+ "num_attention_heads": 40,
177
+ "num_experts_per_tok": 1,
178
+ "num_hidden_layers": 48,
179
+ "num_key_value_heads": 8,
180
+ "num_local_experts": 16,
181
+ "output_router_logits": false,
182
+ "pad_token_id": 200018,
183
+ "rms_norm_eps": 1e-05,
184
+ "rope_scaling": {
185
+ "factor": 16.0,
186
+ "high_freq_factor": 1.0,
187
+ "low_freq_factor": 1.0,
188
+ "original_max_position_embeddings": 8192,
189
+ "rope_type": "llama3"
190
+ },
191
+ "rope_theta": 500000.0,
192
+ "router_aux_loss_coef": 0.001,
193
+ "router_jitter_noise": 0.0,
194
+ "tie_word_embeddings": false,
195
+ "transformers_version": "4.57.1",
196
+ "use_cache": true,
197
+ "use_qk_norm": true,
198
+ "vocab_size": 202048
199
+ }
model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22962e9c7dfa3f39d5446c73f7967664f79d1b2d5a7ee27849742e8e15c67d01
3
+ size 942560965
neuron_config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_serialized_key": "NxDNeuronConfig",
3
+ "batch_size": 1,
4
+ "capacity_factor": null,
5
+ "checkpoint_id": "meta-llama/Llama-4-Scout-17B-16E-Instruct",
6
+ "checkpoint_revision": "92f3b1597a195b523d8d9e5700e57e4fbb8f20d3",
7
+ "continuous_batching": false,
8
+ "ep_degree": 1,
9
+ "fused_qkv": false,
10
+ "glu_mlp": true,
11
+ "local_ranks_size": 32,
12
+ "max_batch_size": 1,
13
+ "max_context_length": 16384,
14
+ "max_topk": 256,
15
+ "n_active_tokens": 16384,
16
+ "neuronxcc_version": "2.21.18209.0+043b1bf7",
17
+ "on_device_sampling": true,
18
+ "optimum_neuron_version": "0.4.2",
19
+ "output_logits": false,
20
+ "pp_degree": 1,
21
+ "sequence_length": 16384,
22
+ "speculation_length": 0,
23
+ "start_rank_id": 0,
24
+ "target": "trn1",
25
+ "torch_dtype": "bfloat16",
26
+ "tp_degree": 32
27
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|begin_of_text|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|eot|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|finetune_right_pad|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:172c9eb4beafc72601690da3ccfcede5c2e6806a8d5ec1fca33e22acea8023a4
3
+ size 27948578
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff