Upload folder using huggingface_hub
Browse files- LICENSE +21 -0
- chat_template.jinja +2 -2
- config.json +7 -3
- configuration.json +1 -0
- generation_config.json +1 -2
- tokenizer_config.json +1 -1
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2025 Zhipu AI
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
chat_template.jinja
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
|
10 |
## {{ function.name }}
|
11 |
|
12 |
-
{{ function | tojson(indent=4
|
13 |
在调用上述函数时,请使用 Json 格式表示调用的参数。
|
14 |
{%- endfor %}
|
15 |
{%- endif -%}
|
@@ -24,7 +24,7 @@
|
|
24 |
{%- for message in messages if message.role != 'system' %}
|
25 |
{%- set role = message['role'] %}
|
26 |
{%- set content = message['content'] %}
|
27 |
-
{%- set visible = content.split('</think>')
|
28 |
{%- set meta = message.get("metadata", "") %}
|
29 |
|
30 |
{%- if role == 'user' %}
|
|
|
9 |
|
10 |
## {{ function.name }}
|
11 |
|
12 |
+
{{ function | tojson(indent=4)|string }}
|
13 |
在调用上述函数时,请使用 Json 格式表示调用的参数。
|
14 |
{%- endfor %}
|
15 |
{%- endif -%}
|
|
|
24 |
{%- for message in messages if message.role != 'system' %}
|
25 |
{%- set role = message['role'] %}
|
26 |
{%- set content = message['content'] %}
|
27 |
+
{%- set visible = (content.split('</think>')|last).strip() %}
|
28 |
{%- set meta = message.get("metadata", "") %}
|
29 |
|
30 |
{%- if role == 'user' %}
|
config.json
CHANGED
@@ -4,7 +4,11 @@
|
|
4 |
],
|
5 |
"attention_bias": true,
|
6 |
"attention_dropout": 0.0,
|
7 |
-
"eos_token_id":
|
|
|
|
|
|
|
|
|
8 |
"head_dim": 128,
|
9 |
"hidden_act": "silu",
|
10 |
"hidden_size": 4096,
|
@@ -21,8 +25,8 @@
|
|
21 |
"rope_theta": 10000.0,
|
22 |
"tie_word_embeddings": false,
|
23 |
"torch_dtype": "bfloat16",
|
24 |
-
"transformers_version": "4.52.
|
25 |
"unsloth_fixed": true,
|
26 |
"use_cache": true,
|
27 |
"vocab_size": 151552
|
28 |
-
}
|
|
|
4 |
],
|
5 |
"attention_bias": true,
|
6 |
"attention_dropout": 0.0,
|
7 |
+
"eos_token_id": [
|
8 |
+
151329,
|
9 |
+
151336,
|
10 |
+
151338
|
11 |
+
],
|
12 |
"head_dim": 128,
|
13 |
"hidden_act": "silu",
|
14 |
"hidden_size": 4096,
|
|
|
25 |
"rope_theta": 10000.0,
|
26 |
"tie_word_embeddings": false,
|
27 |
"torch_dtype": "bfloat16",
|
28 |
+
"transformers_version": "4.52.4",
|
29 |
"unsloth_fixed": true,
|
30 |
"use_cache": true,
|
31 |
"vocab_size": 151552
|
32 |
+
}
|
configuration.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"framework":"Pytorch","task":"text-generation"}
|
generation_config.json
CHANGED
@@ -5,7 +5,6 @@
|
|
5 |
151336,
|
6 |
151338
|
7 |
],
|
8 |
-
"
|
9 |
-
"pad_token_id": 151330,
|
10 |
"transformers_version": "4.52.0.dev0"
|
11 |
}
|
|
|
5 |
151336,
|
6 |
151338
|
7 |
],
|
8 |
+
"pad_token_id": 151329,
|
|
|
9 |
"transformers_version": "4.52.0.dev0"
|
10 |
}
|
tokenizer_config.json
CHANGED
@@ -144,5 +144,5 @@
|
|
144 |
"remove_space": false,
|
145 |
"tokenizer_class": "PreTrainedTokenizer",
|
146 |
"unk_token": null,
|
147 |
-
"chat_template": "[gMASK]<sop>\n{%- if tools -%}\n<|system|>\n
|
148 |
}
|
|
|
144 |
"remove_space": false,
|
145 |
"tokenizer_class": "PreTrainedTokenizer",
|
146 |
"unk_token": null,
|
147 |
+
"chat_template": "[gMASK]<sop>\n{%- if tools -%}\n<|system|>\n你是一个名为 ChatGLM 的人工智能助手。你是基于智谱 AI 公司训练的语言模型 GLM-4 模型开发的,你的任务是针对用户的问题和要求提供适当的答复和支持。\n\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)|string }}\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 visible = (content.split('</think>')|last).strip() %}\n {%- set meta = message.get(\"metadata\", \"\") %}\n\n {%- if role == 'user' %}\n<|user|>\n{{ visible }}\n {%- elif role == 'assistant' and not meta %}\n<|assistant|>\n{{ visible }}\n {%- elif role == 'assistant' and meta %}\n<|assistant|>{{ meta }}\n{{ visible }}\n {%- elif role == 'observation' %}\n<|observation|>\n{{ visible }}\n {%- endif %}\n{%- endfor %}\n{% if add_generation_prompt %}<|assistant|>\n<think>{% endif %}"
|
148 |
}
|