anilguleroglu commited on
Commit
1e82ee4
·
verified ·
1 Parent(s): 09f575d

Upload model trained with Unsloth

Browse files

Upload model trained with Unsloth 2x faster

chat_template.jinja ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {%- if custom_tools is defined %}
3
+ {%- set tools = custom_tools %}
4
+ {%- endif %}
5
+ {%- if not tools_in_user_message is defined %}
6
+ {%- set tools_in_user_message = true %}
7
+ {%- endif %}
8
+ {%- if not tools is defined %}
9
+ {%- set tools = none %}
10
+ {%- endif %}
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 system_message = messages[0]['content']|trim %}
15
+ {%- set messages = messages[1:] %}
16
+ {%- else %}
17
+ {%- set system_message = "" %}
18
+ {%- endif %}
19
+
20
+ {#- System message + builtin tools #}
21
+ {{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
22
+ {%- if builtin_tools is defined or tools is not none %}
23
+ {{- "Environment: ipython\n" }}
24
+ {%- endif %}
25
+ {%- if builtin_tools is defined %}
26
+ {{- "Tools: " + builtin_tools | reject('equalto', 'code_interpreter') | join(", ") + "\n\n"}}
27
+ {%- endif %}
28
+
29
+ {%- if tools is not none and not tools_in_user_message %}
30
+ {{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
31
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
32
+ {{- "Do not use variables.\n\n" }}
33
+ {%- for t in tools %}
34
+ {{- t | tojson(indent=4) }}
35
+ {{- "\n\n" }}
36
+ {%- endfor %}
37
+ {%- endif %}
38
+ {{- system_message }}
39
+ {{- "<|eot_id|>" }}
40
+
41
+ {#- Custom tools are passed in a user message with some extra guidance #}
42
+ {%- if tools_in_user_message and not tools is none %}
43
+ {#- Extract the first user message so we can plug it in here #}
44
+ {%- if messages | length != 0 %}
45
+ {%- set first_user_message = messages[0]['content']|trim %}
46
+ {%- set messages = messages[1:] %}
47
+ {%- else %}
48
+ {{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
49
+ {%- endif %}
50
+ {{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
51
+ {{- "Given the following functions, please respond with a JSON for a function call " }}
52
+ {{- "with its proper arguments that best answers the given prompt.\n\n" }}
53
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
54
+ {{- "Do not use variables.\n\n" }}
55
+ {%- for t in tools %}
56
+ {{- t | tojson(indent=4) }}
57
+ {{- "\n\n" }}
58
+ {%- endfor %}
59
+ {{- first_user_message + "<|eot_id|>"}}
60
+ {%- endif %}
61
+
62
+ {%- for message in messages %}
63
+ {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
64
+ {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
65
+ {%- elif 'tool_calls' in message %}
66
+ {%- if not message.tool_calls|length == 1 %}
67
+ {{- raise_exception("This model only supports single tool-calls at once!") }}
68
+ {%- endif %}
69
+ {%- set tool_call = message.tool_calls[0].function %}
70
+ {%- if builtin_tools is defined and tool_call.name in builtin_tools %}
71
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
72
+ {{- "<|python_tag|>" + tool_call.name + ".call(" }}
73
+ {%- for arg_name, arg_val in tool_call.arguments | items %}
74
+ {{- arg_name + '="' + arg_val + '"' }}
75
+ {%- if not loop.last %}
76
+ {{- ", " }}
77
+ {%- endif %}
78
+ {%- endfor %}
79
+ {{- ")" }}
80
+ {%- else %}
81
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
82
+ {{- '{"name": "' + tool_call.name + '", ' }}
83
+ {{- '"parameters": ' }}
84
+ {{- tool_call.arguments | tojson }}
85
+ {{- "}" }}
86
+ {%- endif %}
87
+ {%- if builtin_tools is defined %}
88
+ {{- "<|eom_id|>" }}
89
+ {%- else %}
90
+ {{- "<|eot_id|>" }}
91
+ {%- endif %}
92
+ {%- elif message.role == "tool" or message.role == "ipython" %}
93
+ {{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
94
+ {%- if message.content is mapping or message.content is iterable %}
95
+ {{- message.content | tojson }}
96
+ {%- else %}
97
+ {{- message.content }}
98
+ {%- endif %}
99
+ {{- "<|eot_id|>" }}
100
+ {%- endif %}
101
+ {%- endfor %}
102
+ {%- if add_generation_prompt %}
103
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
104
+ {%- endif %}
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_id|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|pad|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": null,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<|begin_of_text|>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<|end_of_text|>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "<|pad|>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ },
30
+ "3": {
31
+ "content": "<|start_header_id|>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": true
37
+ },
38
+ "4": {
39
+ "content": "<|end_header_id|>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": true
45
+ },
46
+ "5": {
47
+ "content": "<|eot_id|>",
48
+ "lstrip": false,
49
+ "normalized": false,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": true
53
+ },
54
+ "32000": {
55
+ "content": "<unk>",
56
+ "lstrip": false,
57
+ "normalized": false,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": true
61
+ }
62
+ },
63
+ "bos_token": "<|begin_of_text|>",
64
+ "clean_up_tokenization_spaces": true,
65
+ "eos_token": "<|eot_id|>",
66
+ "extra_special_tokens": {},
67
+ "legacy": true,
68
+ "model_max_length": 2048,
69
+ "pad_token": "<|pad|>",
70
+ "padding_side": "right",
71
+ "tokenizer_class": "LlamaTokenizerFast",
72
+ "unk_token": "<unk>",
73
+ "use_default_system_prompt": false
74
+ }