MCult01 commited on
Commit
c845208
·
verified ·
1 Parent(s): 476025a

(Trained with Unsloth)

Browse files
Files changed (5) hide show
  1. .gitattributes +1 -0
  2. chat_template.jinja +41 -0
  3. config.json +33 -0
  4. tokenizer.json +3 -0
  5. tokenizer_config.json +17 -0
.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
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 ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Glm4ForCausalLM"
4
+ ],
5
+ "attention_bias": true,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": null,
8
+ "torch_dtype": "bfloat16",
9
+ "eos_token_id": 151336,
10
+ "head_dim": 128,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 4096,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 13696,
15
+ "max_position_embeddings": 32768,
16
+ "model_name": "THUDM/GLM-4-9B-0414",
17
+ "model_type": "glm4",
18
+ "num_attention_heads": 32,
19
+ "num_hidden_layers": 40,
20
+ "num_key_value_heads": 2,
21
+ "pad_token_id": 151329,
22
+ "partial_rotary_factor": 0.5,
23
+ "rms_norm_eps": 1e-05,
24
+ "rope_parameters": {
25
+ "partial_rotary_factor": 0.5,
26
+ "rope_theta": 10000.0,
27
+ "rope_type": "default"
28
+ },
29
+ "tie_word_embeddings": false,
30
+ "unsloth_version": "2026.4.4",
31
+ "use_cache": false,
32
+ "vocab_size": 151552
33
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76ebeac0d8bd7879ead7b43c16b44981f277e47225de2bd7de9ae1a6cc664a8c
3
+ size 19966496
tokenizer_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "clean_up_tokenization_spaces": false,
4
+ "do_lower_case": false,
5
+ "eos_token": "<|user|>",
6
+ "is_local": false,
7
+ "model_input_names": [
8
+ "input_ids",
9
+ "attention_mask"
10
+ ],
11
+ "model_max_length": 128000,
12
+ "pad_token": "<|endoftext|>",
13
+ "padding_side": "left",
14
+ "remove_space": false,
15
+ "tokenizer_class": "TokenizersBackend",
16
+ "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 %}"
17
+ }