danielhanchen commited on
Commit
f7a8ffb
·
verified ·
1 Parent(s): 8e093a7

Upload folder using huggingface_hub

Browse files
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, ensure_ascii=False) }}
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>')[-1].strip() %}
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": 151329,
 
 
 
 
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.0.dev0",
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
- "max_length": 32768,
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\u4f60\u662f\u4e00\u4e2a\u540d\u4e3a ChatGLM \u7684\u4eba\u5de5\u667a\u80fd\u52a9\u624b\u3002\u4f60\u662f\u57fa\u4e8e\u667a\u8c31 AI \u516c\u53f8\u8bad\u7ec3\u7684\u8bed\u8a00\u6a21\u578b GLM-4 \u6a21\u578b\u5f00\u53d1\u7684\uff0c\u4f60\u7684\u4efb\u52a1\u662f\u9488\u5bf9\u7528\u6237\u7684\u95ee\u9898\u548c\u8981\u6c42\u63d0\u4f9b\u9002\u5f53\u7684\u7b54\u590d\u548c\u652f\u6301\u3002\n\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 visible = content.split('</think>')[-1].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
  }
 
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
  }