HavocK1 commited on
Commit
2900517
·
verified ·
1 Parent(s): 4dd1ddd

backup expert_05_Tool_Calling full_ft

Browse files
.gitattributes CHANGED
@@ -37,3 +37,4 @@ expert_01_Captain/full_ft/tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
  expert_02_Python_Coding/full_ft/tokenizer.json filter=lfs diff=lfs merge=lfs -text
38
  expert_03_Verified_Python/full_ft/tokenizer.json filter=lfs diff=lfs merge=lfs -text
39
  expert_04_Code_Reasoning/full_ft/tokenizer.json filter=lfs diff=lfs merge=lfs -text
 
 
37
  expert_02_Python_Coding/full_ft/tokenizer.json filter=lfs diff=lfs merge=lfs -text
38
  expert_03_Verified_Python/full_ft/tokenizer.json filter=lfs diff=lfs merge=lfs -text
39
  expert_04_Code_Reasoning/full_ft/tokenizer.json filter=lfs diff=lfs merge=lfs -text
40
+ expert_05_Tool_Calling/full_ft/tokenizer.json filter=lfs diff=lfs merge=lfs -text
expert_05_Tool_Calling/full_ft/chat_template.jinja ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#- Default system message if no system prompt is passed. #}
2
+ {%- set default_system_message = '' %}
3
+
4
+ {#- Begin of sequence token. #}
5
+ {{- bos_token }}
6
+
7
+ {#- Handle system prompt if it exists. #}
8
+ {#- System prompt supports text content or text chunks. #}
9
+ {%- if messages[0]['role'] == 'system' %}
10
+ {{- '[SYSTEM_PROMPT]' -}}
11
+ {%- if messages[0]['content'] is string %}
12
+ {{- messages[0]['content'] -}}
13
+ {%- else %}
14
+ {%- for block in messages[0]['content'] %}
15
+ {%- if block['type'] == 'text' %}
16
+ {{- block['text'] }}
17
+ {%- else %}
18
+ {{- raise_exception('Only text chunks are supported in system message contents.') }}
19
+ {%- endif %}
20
+ {%- endfor %}
21
+ {%- endif %}
22
+ {{- '[/SYSTEM_PROMPT]' -}}
23
+ {%- set loop_messages = messages[1:] %}
24
+ {%- else %}
25
+ {%- set loop_messages = messages %}
26
+ {%- if default_system_message != '' %}
27
+ {{- '[SYSTEM_PROMPT]' + default_system_message + '[/SYSTEM_PROMPT]' }}
28
+ {%- endif %}
29
+ {%- endif %}
30
+
31
+
32
+ {#- Tools definition #}
33
+ {%- set tools_definition = '' %}
34
+ {%- set has_tools = false %}
35
+ {%- if tools is defined and tools is not none and tools|length > 0 %}
36
+ {%- set has_tools = true %}
37
+ {%- set tools_definition = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %}
38
+ {{- tools_definition }}
39
+ {%- endif %}
40
+
41
+ {#- Checks for alternating user/assistant messages. #}
42
+ {%- set ns = namespace(index=0) %}
43
+ {%- for message in loop_messages %}
44
+ {%- if message.role == 'user' or (message.role == 'assistant' and (message.tool_calls is not defined or message.tool_calls is none or message.tool_calls | length == 0)) %}
45
+ {%- if (message['role'] == 'user') != (ns.index % 2 == 0) %}
46
+ {{- raise_exception('After the optional system message, conversation roles must alternate user and assistant messages except for tool calls and results.') }}
47
+ {%- endif %}
48
+ {%- set ns.index = ns.index + 1 %}
49
+ {%- endif %}
50
+ {%- endfor %}
51
+
52
+ {#- Handle conversation messages. #}
53
+ {%- for message in loop_messages %}
54
+
55
+ {#- User messages supports text content or text and image chunks. #}
56
+ {%- if message['role'] == 'user' %}
57
+ {%- if message['content'] is string %}
58
+ {{- '[INST]' + message['content'] + '[/INST]' }}
59
+ {%- elif message['content'] | length > 0 %}
60
+ {{- '[INST]' }}
61
+ {%- if message['content'] | length == 2 %}
62
+ {%- set blocks = message['content'] | sort(attribute='type') %}
63
+ {%- else %}
64
+ {%- set blocks = message['content'] %}
65
+ {%- endif %}
66
+ {%- for block in blocks %}
67
+ {%- if block['type'] == 'text' %}
68
+ {{- block['text'] }}
69
+ {%- elif block['type'] in ['image', 'image_url'] %}
70
+ {{- '[IMG]' }}
71
+ {%- else %}
72
+ {{- raise_exception('Only text, image and image_url chunks are supported in user message content.') }}
73
+ {%- endif %}
74
+ {%- endfor %}
75
+ {{- '[/INST]' }}
76
+ {%- else %}
77
+ {{- raise_exception('User message must have a string or a list of chunks in content') }}
78
+ {%- endif %}
79
+
80
+ {#- Assistant messages supports text content or text and image chunks. #}
81
+ {%- elif message['role'] == 'assistant' %}
82
+ {%- if (message['content'] is none or message['content'] == '' or message['content']|length == 0) and (message['tool_calls'] is not defined or message['tool_calls'] is none or message['tool_calls']|length == 0) %}
83
+ {{- raise_exception('Assistant message must have a string or a list of chunks in content or a list of tool calls.') }}
84
+ {%- endif %}
85
+
86
+ {%- generation %}
87
+ {%- if message['content'] is string %}
88
+ {{- message['content'] }}
89
+ {%- elif message['content'] | length > 0 %}
90
+ {%- for block in message['content'] %}
91
+ {%- if block['type'] == 'text' %}
92
+ {{- block['text'] }}
93
+ {%- else %}
94
+ {{- raise_exception('Only text chunks are supported in assistant message contents.') }}
95
+ {%- endif %}
96
+ {%- endfor %}
97
+ {%- endif %}
98
+
99
+ {%- if message['tool_calls'] is defined and message['tool_calls'] is not none and message['tool_calls']|length > 0 %}
100
+ {%- for tool in message['tool_calls'] %}
101
+ {%- set arguments = tool['function']['arguments'] %}
102
+ {%- if arguments is not string %}
103
+ {%- set arguments = arguments|tojson|safe %}
104
+ {%- elif arguments == '' %}
105
+ {%- set arguments = '{}' %}
106
+ {%- endif %}
107
+ {{- '[TOOL_CALLS]' + tool['function']['name'] + '[ARGS]' + arguments }}
108
+ {%- endfor %}
109
+ {%- endif %}
110
+ {%- endgeneration %}
111
+
112
+ {#- End of sequence token for each assistant messages. #}
113
+ {{- eos_token }}
114
+
115
+ {#- Tool messages only supports text content. #}
116
+ {%- elif message['role'] == 'tool' %}
117
+ {{- '[TOOL_RESULTS]' + message['content']|string + '[/TOOL_RESULTS]' }}
118
+
119
+ {#- Raise exception for unsupported roles. #}
120
+ {%- else %}
121
+ {{- raise_exception('Only user, assistant and tool roles are supported, got ' + message['role'] + '.') }}
122
+ {%- endif %}
123
+ {%- endfor %}
expert_05_Tool_Calling/full_ft/config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Ministral3ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 1,
7
+ "dtype": "bfloat16",
8
+ "eos_token_id": 2,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 3072,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 9216,
14
+ "max_position_embeddings": 262144,
15
+ "model_type": "mistral",
16
+ "num_attention_heads": 32,
17
+ "num_hidden_layers": 26,
18
+ "num_key_value_heads": 8,
19
+ "pad_token_id": 11,
20
+ "rms_norm_eps": 1e-05,
21
+ "rope_parameters": {
22
+ "beta_fast": 32.0,
23
+ "beta_slow": 1.0,
24
+ "factor": 16.0,
25
+ "llama_4_scaling_beta": 0.1,
26
+ "mscale": 1.0,
27
+ "mscale_all_dim": 1.0,
28
+ "original_max_position_embeddings": 16384,
29
+ "rope_theta": 1000000.0,
30
+ "rope_type": "yarn",
31
+ "type": "yarn"
32
+ },
33
+ "sliding_window": null,
34
+ "tie_word_embeddings": true,
35
+ "transformers_version": "5.5.0",
36
+ "use_cache": false,
37
+ "vocab_size": 131072
38
+ }
expert_05_Tool_Calling/full_ft/config.json.bak ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Ministral3ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 1,
7
+ "dtype": "bfloat16",
8
+ "eos_token_id": 2,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 3072,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 9216,
14
+ "max_position_embeddings": 262144,
15
+ "model_type": "ministral3",
16
+ "num_attention_heads": 32,
17
+ "num_hidden_layers": 26,
18
+ "num_key_value_heads": 8,
19
+ "pad_token_id": 11,
20
+ "rms_norm_eps": 1e-05,
21
+ "rope_parameters": {
22
+ "beta_fast": 32.0,
23
+ "beta_slow": 1.0,
24
+ "factor": 16.0,
25
+ "llama_4_scaling_beta": 0.1,
26
+ "mscale": 1.0,
27
+ "mscale_all_dim": 1.0,
28
+ "original_max_position_embeddings": 16384,
29
+ "rope_theta": 1000000.0,
30
+ "rope_type": "yarn",
31
+ "type": "yarn"
32
+ },
33
+ "sliding_window": null,
34
+ "tie_word_embeddings": true,
35
+ "transformers_version": "5.5.0",
36
+ "use_cache": false,
37
+ "vocab_size": 131072
38
+ }
expert_05_Tool_Calling/full_ft/generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 1,
3
+ "eos_token_id": [
4
+ 2
5
+ ],
6
+ "max_length": 262144,
7
+ "pad_token_id": 11,
8
+ "transformers_version": "5.5.0"
9
+ }
expert_05_Tool_Calling/full_ft/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd9a1884fcf1f0a6e2930676d8d2f4f5d41fbb0fbad437636c25f7947389e22c
3
+ size 6858040048
expert_05_Tool_Calling/full_ft/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:577575622324b2e099e2648be26bdeb5e5815ffe66d7004e9e3ddbf421db6bf1
3
+ size 17078110
expert_05_Tool_Calling/full_ft/tokenizer_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": null,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<s>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "</s>",
7
+ "is_local": true,
8
+ "legacy": true,
9
+ "model_max_length": 1000000000000000019884624838656,
10
+ "pad_token": "<pad>",
11
+ "processor_class": "PixtralProcessor",
12
+ "tokenizer_class": "TokenizersBackend",
13
+ "unk_token": "<unk>",
14
+ "use_default_system_prompt": false
15
+ }