Kanompung commited on
Commit
de94349
·
verified ·
1 Parent(s): c4ae6e6

Upload model trained with Unsloth

Browse files

Upload model trained with Unsloth 2x faster

.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
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<image_soft_token>": 262144
3
+ }
chat_template.jinja ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#- Begin-of-sequence token to start the model prompt -#}
2
+ {{ bos_token }}
3
+ {#- Extracts the system message. Gemma does not support system messages so it will be prepended to first user message. -#}
4
+ {%- if messages[0]['role'] == 'system' -%}
5
+ {%- if messages[0]['content'] is string -%}
6
+ {%- set first_user_prefix = messages[0]['content'] -%}
7
+ {%- else -%}
8
+ {%- set first_user_prefix = messages[0]['content'][0]['text'] -%}
9
+ {%- endif -%}
10
+ {%- set loop_messages = messages[1:] -%}
11
+ {%- else -%}
12
+ {%- set first_user_prefix = "You are a helpful assistant named Typhoon created by SCB 10X to be helpful, harmless, and honest." -%}
13
+ {%- set loop_messages = messages -%}
14
+ {%- endif -%}
15
+ {%- if enable_thinking is defined and enable_thinking is true %}
16
+ {%- set first_user_prefix = first_user_prefix + " First, think through the reasoning internally, then present the reasoning within <think>...</think>. After thinking, clearly state a response that addresses the user's request and aligns with their preferences, not just providing a direct answer." -%}
17
+ {%- endif %}
18
+ {%- set first_user_prefix = first_user_prefix + '\n\n' -%}
19
+ {#- Set tools to none if not defined for this ChatCompletion request (helps avoid errors later) -#}
20
+ {%- if not tools is defined %}
21
+ {%- set tools = none %}
22
+ {%- endif %}
23
+
24
+ {#- If given only system message -#}
25
+ {%- if loop_messages|length == 0 -%}
26
+ {{ '<start_of_turn>user\n' -}}
27
+ {{ first_user_prefix }}
28
+ {#- Append system message with tool information if using tools in message request. -#}
29
+ {%- if tools is not none -%}
30
+ {{- "Tools (functions) are available. If you decide to invoke one or more of the tools, you must respond with a python list of the function calls.\n" -}}
31
+ {{- "Example Format: [func_name1(params_name1=params_value1, params_name2=params_value2...), func_name2(params)] \n" -}}
32
+ {{- "Do not use variables. DO NOT USE MARKDOWN SYNTAX. You SHOULD NOT include any other text in the response if you call a function. If none of the functions can be used, point it out. If you lack the parameters required by the function, also point it out.\n" -}}
33
+ {{- "Here is a list of functions in JSON format that you can invoke.\n" -}}
34
+ {{- tools | tojson(indent=4) -}}
35
+ {{- "\n\n" -}}
36
+ {%- endif -%}
37
+ {%- endif %}
38
+
39
+ {#- Main loop over all messages in the conversation history -#}
40
+ {%- for message in loop_messages -%}
41
+ {#- Normalize roles for model prompt formatting -#}
42
+ {%- if (message['role'] == 'assistant') -%}
43
+ {%- set role = "model" -%}
44
+ {%- elif (message['role'] == 'tool') -%}
45
+ {%- set role = "user" -%}
46
+ {%- else -%}
47
+ {%- set role = message['role'] -%}
48
+ {%- endif -%}
49
+ {#- Mark the start of a message block with the appropriate role -#}
50
+ {{ '<start_of_turn>' + role + '\n' -}}
51
+
52
+ {#- Insert system message content (if present) at the beginning of the first message. -#}
53
+ {%- if loop.first -%}
54
+ {{ first_user_prefix }}
55
+ {#- Append system message with tool information if using tools in message request. -#}
56
+ {%- if tools is not none -%}
57
+ {{- "Tools (functions) are available. If you decide to invoke one or more of the tools, you must respond with a python list of the function calls.\n" -}}
58
+ {{- "Example Format: [func_name1(params_name1=params_value1, params_name2=params_value2...), func_name2(params)] \n" -}}
59
+ {{- "Do not use variables. DO NOT USE MARKDOWN SYNTAX. You SHOULD NOT include any other text in the response if you call a function. If none of the functions can be used, point it out. If you lack the parameters required by the function, also point it out.\n" -}}
60
+ {{- "Here is a list of functions in JSON format that you can invoke.\n" -}}
61
+ {{- tools | tojson(indent=4) -}}
62
+ {{- "\n\n" -}}
63
+ {%- endif -%}
64
+ {%- endif -%}
65
+
66
+ {#- Format model tool calls (turns where model indicates they want to call a tool) -#}
67
+ {%- if 'tool_calls' in message -%}
68
+ {#- Opening bracket for tool call list. -#}
69
+ {{- '[' -}}
70
+ {#- For each tool call -#}
71
+ {%- for tool_call in message.tool_calls -%}
72
+ {#- Function name & opening parenthesis. -#}
73
+ {%- if tool_call.function is defined -%}
74
+ {%- set tool_call = tool_call.function -%}
75
+ {%- endif -%}
76
+ {{- tool_call.name + '(' -}}
77
+
78
+ {#-- Handle arguments as list (positional) or dict (named) --#}
79
+ {#-- Named arguments (dict) --#}
80
+ {%- if tool_call.arguments is iterable and tool_call.arguments is mapping -%}
81
+ {%- set first = true -%}
82
+ {%- for key, val in tool_call.arguments.items() -%}
83
+ {%- if not first %}, {% endif -%}
84
+ {{ key }}={{ val | tojson }}
85
+ {%- set first = false -%}
86
+ {%- endfor -%}
87
+ {#-- Positional arguments (list) --#}
88
+ {%- elif tool_call.arguments is iterable -%}
89
+ {{- tool_call.arguments | map('tojson') | join(', ') -}}
90
+ {#-- Fallback: single positional value --#}
91
+ {%- else -%}
92
+ {{- tool_call.arguments | tojson -}}
93
+ {#-- Closing parenthesis. --#}
94
+ {%- endif -%}
95
+ {{- ')' -}}
96
+ {#-- If more than one tool call, place comma and move to formatting next tool call --#}
97
+ {%- if not loop.last -%}, {% endif -%}
98
+ {%- endfor -%}
99
+ {#- Closing bracket for tool call list. -#}
100
+ {{- ']' -}}
101
+ {%- endif -%}
102
+
103
+ {#- Tool response start tag (for messages from a tool) -#}
104
+ {%- if (message['role'] == 'tool') -%}
105
+ {{ '<tool_response>\n' -}}
106
+ {%- endif -%}
107
+
108
+ {#- Render the message content: handle plain string or multimodal content like image/text -#}
109
+ {%- if message['content'] is string -%}
110
+ {%- set content = message['content'] -%}
111
+ {%- if '</think>' in content -%}
112
+ {%- set content = content.split('</think>')[-1] -%}
113
+ {%- endif -%}
114
+ {{ content | trim }}
115
+ {%- elif message['content'] is iterable -%}
116
+ {%- for item in message['content'] -%}
117
+ {%- if item['type'] == 'image' -%}
118
+ {{ '<start_of_image>' }}
119
+ {%- elif item['type'] == 'text' -%}
120
+ {%- set content = item['text'] -%}
121
+ {%- if '</think>' in content -%}
122
+ {%- set content = content.split('</think>')[-1] -%}
123
+ {%- endif -%}
124
+ {{ content | trim }}
125
+ {%- endif -%}
126
+ {%- endfor -%}
127
+ {%- else -%}
128
+ {{ raise_exception("Invalid content type") }}
129
+ {%- endif -%}
130
+
131
+ {#- Tool response end tag -#}
132
+ {%- if (message['role'] == 'tool') -%}
133
+ {{ '</tool_response>' -}}
134
+ {%- endif -%}
135
+
136
+ {#- Mark end of a single turn -#}
137
+ {{ '<end_of_turn>\n' }}
138
+ {%- endfor -%}
139
+
140
+ {#- If generation is to be triggered, add model prompt prefix -#}
141
+ {%- if add_generation_prompt -%}
142
+ {{'<start_of_turn>model\n'}}
143
+ {%- if enable_thinking is defined and enable_thinking is true -%}
144
+ {{- '<think>' -}}
145
+ {%- endif %}
146
+ {%- endif -%}
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "boi_token": "<start_of_image>",
3
+ "bos_token": {
4
+ "content": "<bos>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ "eoi_token": "<end_of_image>",
11
+ "eos_token": {
12
+ "content": "<end_of_turn>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "image_token": "<image_soft_token>",
19
+ "pad_token": {
20
+ "content": "<pad>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<unk>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795
3
+ size 33384568
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
3
+ size 4689074
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff