Add files using upload-large-folder tool
Browse files- chat_template.jinja +41 -0
- config.json +1 -1
- generation_config.json +1 -1
- tokenizer_config.json +3 -3
chat_template.jinja
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[gMASK]<sop>
|
2 |
+
{%- if tools -%}
|
3 |
+
<|system|>
|
4 |
+
# 可用工具
|
5 |
+
{% for tool in tools %}
|
6 |
+
{%- set function = tool.function if tool.get("function") else tool %}
|
7 |
+
|
8 |
+
## {{ function.name }}
|
9 |
+
|
10 |
+
{{ function | tojson(indent=4, ensure_ascii=False) }}
|
11 |
+
在调用上述函数时,请使用 Json 格式表示调用的参数。
|
12 |
+
{%- endfor %}
|
13 |
+
{%- endif -%}
|
14 |
+
|
15 |
+
{%- for msg in messages %}
|
16 |
+
{%- if msg.role == 'system' %}
|
17 |
+
<|system|>
|
18 |
+
{{ msg.content }}
|
19 |
+
{%- endif %}
|
20 |
+
{%- endfor %}
|
21 |
+
|
22 |
+
{%- for message in messages if message.role != 'system' %}
|
23 |
+
{%- set role = message['role'] %}
|
24 |
+
{%- set content = message['content'] %}
|
25 |
+
{%- set meta = message.get("metadata", "") %}
|
26 |
+
|
27 |
+
{%- if role == 'user' %}
|
28 |
+
<|user|>
|
29 |
+
{{ content }}
|
30 |
+
{%- elif role == 'assistant' and not meta %}
|
31 |
+
<|assistant|>
|
32 |
+
{{ content }}
|
33 |
+
{%- elif role == 'assistant' and meta %}
|
34 |
+
<|assistant|>{{ meta }}
|
35 |
+
{{ content }}
|
36 |
+
{%- elif role == 'observation' %}
|
37 |
+
<|observation|>
|
38 |
+
{{ content }}
|
39 |
+
{%- endif %}
|
40 |
+
{%- endfor %}
|
41 |
+
{% if add_generation_prompt %}<|assistant|>{% endif %}
|
config.json
CHANGED
@@ -41,7 +41,7 @@
|
|
41 |
"rope_theta": 10000.0,
|
42 |
"tie_word_embeddings": false,
|
43 |
"torch_dtype": "bfloat16",
|
44 |
-
"transformers_version": "4.
|
45 |
"unsloth_fixed": true,
|
46 |
"use_cache": true,
|
47 |
"vocab_size": 151552
|
|
|
41 |
"rope_theta": 10000.0,
|
42 |
"tie_word_embeddings": false,
|
43 |
"torch_dtype": "bfloat16",
|
44 |
+
"transformers_version": "4.52.0.dev0",
|
45 |
"unsloth_fixed": true,
|
46 |
"use_cache": true,
|
47 |
"vocab_size": 151552
|
generation_config.json
CHANGED
@@ -7,5 +7,5 @@
|
|
7 |
],
|
8 |
"max_length": 32768,
|
9 |
"pad_token_id": 151330,
|
10 |
-
"transformers_version": "4.
|
11 |
}
|
|
|
7 |
],
|
8 |
"max_length": 32768,
|
9 |
"pad_token_id": 151330,
|
10 |
+
"transformers_version": "4.52.0.dev0"
|
11 |
}
|
tokenizer_config.json
CHANGED
@@ -130,7 +130,6 @@
|
|
130 |
"<|end_of_video|>"
|
131 |
],
|
132 |
"bos_token": null,
|
133 |
-
"chat_template": "[gMASK]<sop>\n{%- if tools -%}\n<|system|>\n# 可用工具\n{% for tool in tools %}\n {%- set function = tool.function if tool.get(\"function\") else tool %}\n\n## {{ function.name }}\n\n{{ function | tojson(indent=4, ensure_ascii=False) }}\n在调用上述函数时,请使用 Json 格式表示调用的参数。\n{%- endfor %}\n{%- endif -%}\n\n{%- for msg in messages %}\n {%- if msg.role == 'system' %}\n<|system|>\n{{ msg.content }}\n {%- endif %}\n{%- endfor %}\n\n{%- for message in messages if message.role != 'system' %}\n {%- set role = message['role'] %}\n {%- set content = message['content'] %}\n {%- set meta = message.get(\"metadata\", \"\") %}\n\n {%- if role == 'user' %}\n<|user|>\n{{ content }}\n {%- elif role == 'assistant' and not meta %}\n<|assistant|>\n{{ content }}\n {%- elif role == 'assistant' and meta %}\n<|assistant|>{{ meta }}\n{{ content }}\n {%- elif role == 'observation' %}\n<|observation|>\n{{ content }}\n {%- endif %}\n{%- endfor %}\n{% if add_generation_prompt %}<|assistant|>{% endif %}",
|
134 |
"clean_up_tokenization_spaces": false,
|
135 |
"do_lower_case": false,
|
136 |
"eos_token": "<|user|>",
|
@@ -144,5 +143,6 @@
|
|
144 |
"padding_side": "left",
|
145 |
"remove_space": false,
|
146 |
"tokenizer_class": "PreTrainedTokenizer",
|
147 |
-
"unk_token": null
|
148 |
-
}
|
|
|
|
130 |
"<|end_of_video|>"
|
131 |
],
|
132 |
"bos_token": null,
|
|
|
133 |
"clean_up_tokenization_spaces": false,
|
134 |
"do_lower_case": false,
|
135 |
"eos_token": "<|user|>",
|
|
|
143 |
"padding_side": "left",
|
144 |
"remove_space": false,
|
145 |
"tokenizer_class": "PreTrainedTokenizer",
|
146 |
+
"unk_token": null,
|
147 |
+
"chat_template": "[gMASK]<sop>\n{%- if tools -%}\n<|system|>\n# \u53ef\u7528\u5de5\u5177\n{% for tool in tools %}\n {%- set function = tool.function if tool.get(\"function\") else tool %}\n\n## {{ function.name }}\n\n{{ function | tojson(indent=4, ensure_ascii=False) }}\n\u5728\u8c03\u7528\u4e0a\u8ff0\u51fd\u6570\u65f6\uff0c\u8bf7\u4f7f\u7528 Json \u683c\u5f0f\u8868\u793a\u8c03\u7528\u7684\u53c2\u6570\u3002\n{%- endfor %}\n{%- endif -%}\n\n{%- for msg in messages %}\n {%- if msg.role == 'system' %}\n<|system|>\n{{ msg.content }}\n {%- endif %}\n{%- endfor %}\n\n{%- for message in messages if message.role != 'system' %}\n {%- set role = message['role'] %}\n {%- set content = message['content'] %}\n {%- set meta = message.get(\"metadata\", \"\") %}\n\n {%- if role == 'user' %}\n<|user|>\n{{ content }}\n {%- elif role == 'assistant' and not meta %}\n<|assistant|>\n{{ content }}\n {%- elif role == 'assistant' and meta %}\n<|assistant|>{{ meta }}\n{{ content }}\n {%- elif role == 'observation' %}\n<|observation|>\n{{ content }}\n {%- endif %}\n{%- endfor %}\n{% if add_generation_prompt %}<|assistant|>{% endif %}"
|
148 |
+
}
|