Instructions to use unsloth/GLM-4.7-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/GLM-4.7-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/GLM-4.7-Flash") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/GLM-4.7-Flash") model = AutoModelForCausalLM.from_pretrained("unsloth/GLM-4.7-Flash") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use unsloth/GLM-4.7-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/GLM-4.7-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-4.7-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/GLM-4.7-Flash
- SGLang
How to use unsloth/GLM-4.7-Flash with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "unsloth/GLM-4.7-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-4.7-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "unsloth/GLM-4.7-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-4.7-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use unsloth/GLM-4.7-Flash with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/GLM-4.7-Flash to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/GLM-4.7-Flash to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/GLM-4.7-Flash to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="unsloth/GLM-4.7-Flash", max_seq_length=2048, ) - Docker Model Runner
How to use unsloth/GLM-4.7-Flash with Docker Model Runner:
docker model run hf.co/unsloth/GLM-4.7-Flash
Upload folder using huggingface_hub
Browse files- config.json +75 -16
- tokenizer_config.json +9 -298
config.json
CHANGED
|
@@ -4,43 +4,102 @@
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
-
"
|
| 8 |
"eos_token_id": [
|
| 9 |
154820,
|
| 10 |
154827,
|
| 11 |
154829
|
| 12 |
],
|
|
|
|
|
|
|
| 13 |
"hidden_act": "silu",
|
| 14 |
"hidden_size": 2048,
|
|
|
|
| 15 |
"intermediate_size": 10240,
|
|
|
|
| 16 |
"max_position_embeddings": 202752,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"model_type": "glm4_moe_lite",
|
| 18 |
"moe_intermediate_size": 1536,
|
| 19 |
-
"topk_method": "noaux_tc",
|
| 20 |
-
"norm_topk_prob": true,
|
| 21 |
-
"num_attention_heads": 20,
|
| 22 |
"n_group": 1,
|
| 23 |
-
"topk_group": 1,
|
| 24 |
"n_routed_experts": 64,
|
| 25 |
"n_shared_experts": 1,
|
| 26 |
-
"
|
|
|
|
| 27 |
"num_experts_per_tok": 4,
|
| 28 |
-
"first_k_dense_replace": 1,
|
| 29 |
"num_hidden_layers": 47,
|
| 30 |
"num_key_value_heads": 20,
|
| 31 |
"num_nextn_predict_layers": 1,
|
|
|
|
| 32 |
"partial_rotary_factor": 1.0,
|
| 33 |
-
"
|
| 34 |
-
"rope_scaling": null,
|
| 35 |
-
"rope_theta": 1000000,
|
| 36 |
-
"tie_word_embeddings": false,
|
| 37 |
-
"torch_dtype": "bfloat16",
|
| 38 |
-
"transformers_version": "5.0.0rc0",
|
| 39 |
"q_lora_rank": 768,
|
| 40 |
-
"
|
| 41 |
"qk_nope_head_dim": 192,
|
| 42 |
"qk_rope_head_dim": 64,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
"v_head_dim": 256,
|
| 44 |
-
"vocab_size": 154880
|
| 45 |
-
"scoring_func": "sigmoid"
|
| 46 |
}
|
|
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
+
"torch_dtype": "bfloat16",
|
| 8 |
"eos_token_id": [
|
| 9 |
154820,
|
| 10 |
154827,
|
| 11 |
154829
|
| 12 |
],
|
| 13 |
+
"first_k_dense_replace": 1,
|
| 14 |
+
"head_dim": 64,
|
| 15 |
"hidden_act": "silu",
|
| 16 |
"hidden_size": 2048,
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
"intermediate_size": 10240,
|
| 19 |
+
"kv_lora_rank": 512,
|
| 20 |
"max_position_embeddings": 202752,
|
| 21 |
+
"mlp_layer_types": [
|
| 22 |
+
"dense",
|
| 23 |
+
"sparse",
|
| 24 |
+
"sparse",
|
| 25 |
+
"sparse",
|
| 26 |
+
"sparse",
|
| 27 |
+
"sparse",
|
| 28 |
+
"sparse",
|
| 29 |
+
"sparse",
|
| 30 |
+
"sparse",
|
| 31 |
+
"sparse",
|
| 32 |
+
"sparse",
|
| 33 |
+
"sparse",
|
| 34 |
+
"sparse",
|
| 35 |
+
"sparse",
|
| 36 |
+
"sparse",
|
| 37 |
+
"sparse",
|
| 38 |
+
"sparse",
|
| 39 |
+
"sparse",
|
| 40 |
+
"sparse",
|
| 41 |
+
"sparse",
|
| 42 |
+
"sparse",
|
| 43 |
+
"sparse",
|
| 44 |
+
"sparse",
|
| 45 |
+
"sparse",
|
| 46 |
+
"sparse",
|
| 47 |
+
"sparse",
|
| 48 |
+
"sparse",
|
| 49 |
+
"sparse",
|
| 50 |
+
"sparse",
|
| 51 |
+
"sparse",
|
| 52 |
+
"sparse",
|
| 53 |
+
"sparse",
|
| 54 |
+
"sparse",
|
| 55 |
+
"sparse",
|
| 56 |
+
"sparse",
|
| 57 |
+
"sparse",
|
| 58 |
+
"sparse",
|
| 59 |
+
"sparse",
|
| 60 |
+
"sparse",
|
| 61 |
+
"sparse",
|
| 62 |
+
"sparse",
|
| 63 |
+
"sparse",
|
| 64 |
+
"sparse",
|
| 65 |
+
"sparse",
|
| 66 |
+
"sparse",
|
| 67 |
+
"sparse",
|
| 68 |
+
"sparse"
|
| 69 |
+
],
|
| 70 |
"model_type": "glm4_moe_lite",
|
| 71 |
"moe_intermediate_size": 1536,
|
|
|
|
|
|
|
|
|
|
| 72 |
"n_group": 1,
|
|
|
|
| 73 |
"n_routed_experts": 64,
|
| 74 |
"n_shared_experts": 1,
|
| 75 |
+
"norm_topk_prob": true,
|
| 76 |
+
"num_attention_heads": 20,
|
| 77 |
"num_experts_per_tok": 4,
|
|
|
|
| 78 |
"num_hidden_layers": 47,
|
| 79 |
"num_key_value_heads": 20,
|
| 80 |
"num_nextn_predict_layers": 1,
|
| 81 |
+
"pad_token_id": 154821,
|
| 82 |
"partial_rotary_factor": 1.0,
|
| 83 |
+
"pretraining_tp": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
"q_lora_rank": 768,
|
| 85 |
+
"qk_head_dim": 256,
|
| 86 |
"qk_nope_head_dim": 192,
|
| 87 |
"qk_rope_head_dim": 64,
|
| 88 |
+
"rms_norm_eps": 1e-05,
|
| 89 |
+
"rope_interleave": true,
|
| 90 |
+
"rope_parameters": {
|
| 91 |
+
"partial_rotary_factor": 1.0,
|
| 92 |
+
"rope_theta": 1000000,
|
| 93 |
+
"rope_type": "default"
|
| 94 |
+
},
|
| 95 |
+
"routed_scaling_factor": 1.8,
|
| 96 |
+
"scoring_func": "sigmoid",
|
| 97 |
+
"tie_word_embeddings": false,
|
| 98 |
+
"topk_group": 1,
|
| 99 |
+
"topk_method": "noaux_tc",
|
| 100 |
+
"transformers_version": "5.2.0.dev0",
|
| 101 |
+
"unsloth_fixed": true,
|
| 102 |
+
"use_cache": true,
|
| 103 |
"v_head_dim": 256,
|
| 104 |
+
"vocab_size": 154880
|
|
|
|
| 105 |
}
|
tokenizer_config.json
CHANGED
|
@@ -1,295 +1,10 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
"single_word": false,
|
| 9 |
-
"special": true
|
| 10 |
-
},
|
| 11 |
-
"154821": {
|
| 12 |
-
"content": "[MASK]",
|
| 13 |
-
"lstrip": false,
|
| 14 |
-
"normalized": false,
|
| 15 |
-
"rstrip": false,
|
| 16 |
-
"single_word": false,
|
| 17 |
-
"special": true
|
| 18 |
-
},
|
| 19 |
-
"154822": {
|
| 20 |
-
"content": "[gMASK]",
|
| 21 |
-
"lstrip": false,
|
| 22 |
-
"normalized": false,
|
| 23 |
-
"rstrip": false,
|
| 24 |
-
"single_word": false,
|
| 25 |
-
"special": true
|
| 26 |
-
},
|
| 27 |
-
"154823": {
|
| 28 |
-
"content": "[sMASK]",
|
| 29 |
-
"lstrip": false,
|
| 30 |
-
"normalized": false,
|
| 31 |
-
"rstrip": false,
|
| 32 |
-
"single_word": false,
|
| 33 |
-
"special": true
|
| 34 |
-
},
|
| 35 |
-
"154824": {
|
| 36 |
-
"content": "<sop>",
|
| 37 |
-
"lstrip": false,
|
| 38 |
-
"normalized": false,
|
| 39 |
-
"rstrip": false,
|
| 40 |
-
"single_word": false,
|
| 41 |
-
"special": true
|
| 42 |
-
},
|
| 43 |
-
"154825": {
|
| 44 |
-
"content": "<eop>",
|
| 45 |
-
"lstrip": false,
|
| 46 |
-
"normalized": false,
|
| 47 |
-
"rstrip": false,
|
| 48 |
-
"single_word": false,
|
| 49 |
-
"special": true
|
| 50 |
-
},
|
| 51 |
-
"154826": {
|
| 52 |
-
"content": "<|system|>",
|
| 53 |
-
"lstrip": false,
|
| 54 |
-
"normalized": false,
|
| 55 |
-
"rstrip": false,
|
| 56 |
-
"single_word": false,
|
| 57 |
-
"special": true
|
| 58 |
-
},
|
| 59 |
-
"154827": {
|
| 60 |
-
"content": "<|user|>",
|
| 61 |
-
"lstrip": false,
|
| 62 |
-
"normalized": false,
|
| 63 |
-
"rstrip": false,
|
| 64 |
-
"single_word": false,
|
| 65 |
-
"special": true
|
| 66 |
-
},
|
| 67 |
-
"154828": {
|
| 68 |
-
"content": "<|assistant|>",
|
| 69 |
-
"lstrip": false,
|
| 70 |
-
"normalized": false,
|
| 71 |
-
"rstrip": false,
|
| 72 |
-
"single_word": false,
|
| 73 |
-
"special": true
|
| 74 |
-
},
|
| 75 |
-
"154829": {
|
| 76 |
-
"content": "<|observation|>",
|
| 77 |
-
"lstrip": false,
|
| 78 |
-
"normalized": false,
|
| 79 |
-
"rstrip": false,
|
| 80 |
-
"single_word": false,
|
| 81 |
-
"special": true
|
| 82 |
-
},
|
| 83 |
-
"154830": {
|
| 84 |
-
"content": "<|begin_of_image|>",
|
| 85 |
-
"lstrip": false,
|
| 86 |
-
"normalized": false,
|
| 87 |
-
"rstrip": false,
|
| 88 |
-
"single_word": false,
|
| 89 |
-
"special": true
|
| 90 |
-
},
|
| 91 |
-
"154831": {
|
| 92 |
-
"content": "<|end_of_image|>",
|
| 93 |
-
"lstrip": false,
|
| 94 |
-
"normalized": false,
|
| 95 |
-
"rstrip": false,
|
| 96 |
-
"single_word": false,
|
| 97 |
-
"special": true
|
| 98 |
-
},
|
| 99 |
-
"154832": {
|
| 100 |
-
"content": "<|begin_of_video|>",
|
| 101 |
-
"lstrip": false,
|
| 102 |
-
"normalized": false,
|
| 103 |
-
"rstrip": false,
|
| 104 |
-
"single_word": false,
|
| 105 |
-
"special": true
|
| 106 |
-
},
|
| 107 |
-
"154833": {
|
| 108 |
-
"content": "<|end_of_video|>",
|
| 109 |
-
"lstrip": false,
|
| 110 |
-
"normalized": false,
|
| 111 |
-
"rstrip": false,
|
| 112 |
-
"single_word": false,
|
| 113 |
-
"special": true
|
| 114 |
-
},
|
| 115 |
-
"154834": {
|
| 116 |
-
"content": "<|begin_of_audio|>",
|
| 117 |
-
"lstrip": false,
|
| 118 |
-
"normalized": false,
|
| 119 |
-
"rstrip": false,
|
| 120 |
-
"single_word": false,
|
| 121 |
-
"special": true
|
| 122 |
-
},
|
| 123 |
-
"154835": {
|
| 124 |
-
"content": "<|end_of_audio|>",
|
| 125 |
-
"lstrip": false,
|
| 126 |
-
"normalized": false,
|
| 127 |
-
"rstrip": false,
|
| 128 |
-
"single_word": false,
|
| 129 |
-
"special": true
|
| 130 |
-
},
|
| 131 |
-
"154836": {
|
| 132 |
-
"content": "<|begin_of_transcription|>",
|
| 133 |
-
"lstrip": false,
|
| 134 |
-
"normalized": false,
|
| 135 |
-
"rstrip": false,
|
| 136 |
-
"single_word": false,
|
| 137 |
-
"special": true
|
| 138 |
-
},
|
| 139 |
-
"154837": {
|
| 140 |
-
"content": "<|end_of_transcription|>",
|
| 141 |
-
"lstrip": false,
|
| 142 |
-
"normalized": false,
|
| 143 |
-
"rstrip": false,
|
| 144 |
-
"single_word": false,
|
| 145 |
-
"special": true
|
| 146 |
-
},
|
| 147 |
-
"154838": {
|
| 148 |
-
"content": "<|code_prefix|>",
|
| 149 |
-
"lstrip": false,
|
| 150 |
-
"normalized": false,
|
| 151 |
-
"rstrip": false,
|
| 152 |
-
"single_word": false,
|
| 153 |
-
"special": false
|
| 154 |
-
},
|
| 155 |
-
"154839": {
|
| 156 |
-
"content": "<|code_middle|>",
|
| 157 |
-
"lstrip": false,
|
| 158 |
-
"normalized": false,
|
| 159 |
-
"rstrip": false,
|
| 160 |
-
"single_word": false,
|
| 161 |
-
"special": false
|
| 162 |
-
},
|
| 163 |
-
"154840": {
|
| 164 |
-
"content": "<|code_suffix|>",
|
| 165 |
-
"lstrip": false,
|
| 166 |
-
"normalized": false,
|
| 167 |
-
"rstrip": false,
|
| 168 |
-
"single_word": false,
|
| 169 |
-
"special": false
|
| 170 |
-
},
|
| 171 |
-
"154841": {
|
| 172 |
-
"content": "<think>",
|
| 173 |
-
"lstrip": false,
|
| 174 |
-
"normalized": false,
|
| 175 |
-
"rstrip": false,
|
| 176 |
-
"single_word": false,
|
| 177 |
-
"special": false
|
| 178 |
-
},
|
| 179 |
-
"154842": {
|
| 180 |
-
"content": "</think>",
|
| 181 |
-
"lstrip": false,
|
| 182 |
-
"normalized": false,
|
| 183 |
-
"rstrip": false,
|
| 184 |
-
"single_word": false,
|
| 185 |
-
"special": false
|
| 186 |
-
},
|
| 187 |
-
"154843": {
|
| 188 |
-
"content": "<tool_call>",
|
| 189 |
-
"lstrip": false,
|
| 190 |
-
"normalized": false,
|
| 191 |
-
"rstrip": false,
|
| 192 |
-
"single_word": false,
|
| 193 |
-
"special": false
|
| 194 |
-
},
|
| 195 |
-
"154844": {
|
| 196 |
-
"content": "</tool_call>",
|
| 197 |
-
"lstrip": false,
|
| 198 |
-
"normalized": false,
|
| 199 |
-
"rstrip": false,
|
| 200 |
-
"single_word": false,
|
| 201 |
-
"special": false
|
| 202 |
-
},
|
| 203 |
-
"154845": {
|
| 204 |
-
"content": "<tool_response>",
|
| 205 |
-
"lstrip": false,
|
| 206 |
-
"normalized": false,
|
| 207 |
-
"rstrip": false,
|
| 208 |
-
"single_word": false,
|
| 209 |
-
"special": false
|
| 210 |
-
},
|
| 211 |
-
"154846": {
|
| 212 |
-
"content": "</tool_response>",
|
| 213 |
-
"lstrip": false,
|
| 214 |
-
"normalized": false,
|
| 215 |
-
"rstrip": false,
|
| 216 |
-
"single_word": false,
|
| 217 |
-
"special": false
|
| 218 |
-
},
|
| 219 |
-
"154847": {
|
| 220 |
-
"content": "<arg_key>",
|
| 221 |
-
"lstrip": false,
|
| 222 |
-
"normalized": false,
|
| 223 |
-
"rstrip": false,
|
| 224 |
-
"single_word": false,
|
| 225 |
-
"special": false
|
| 226 |
-
},
|
| 227 |
-
"154848": {
|
| 228 |
-
"content": "</arg_key>",
|
| 229 |
-
"lstrip": false,
|
| 230 |
-
"normalized": false,
|
| 231 |
-
"rstrip": false,
|
| 232 |
-
"single_word": false,
|
| 233 |
-
"special": false
|
| 234 |
-
},
|
| 235 |
-
"154849": {
|
| 236 |
-
"content": "<arg_value>",
|
| 237 |
-
"lstrip": false,
|
| 238 |
-
"normalized": false,
|
| 239 |
-
"rstrip": false,
|
| 240 |
-
"single_word": false,
|
| 241 |
-
"special": false
|
| 242 |
-
},
|
| 243 |
-
"154850": {
|
| 244 |
-
"content": "</arg_value>",
|
| 245 |
-
"lstrip": false,
|
| 246 |
-
"normalized": false,
|
| 247 |
-
"rstrip": false,
|
| 248 |
-
"single_word": false,
|
| 249 |
-
"special": false
|
| 250 |
-
},
|
| 251 |
-
"154851": {
|
| 252 |
-
"content": "/nothink",
|
| 253 |
-
"lstrip": false,
|
| 254 |
-
"normalized": false,
|
| 255 |
-
"rstrip": false,
|
| 256 |
-
"single_word": false,
|
| 257 |
-
"special": false
|
| 258 |
-
},
|
| 259 |
-
"154852": {
|
| 260 |
-
"content": "<|begin_of_box|>",
|
| 261 |
-
"lstrip": false,
|
| 262 |
-
"normalized": false,
|
| 263 |
-
"rstrip": false,
|
| 264 |
-
"single_word": false,
|
| 265 |
-
"special": false
|
| 266 |
-
},
|
| 267 |
-
"154853": {
|
| 268 |
-
"content": "<|end_of_box|>",
|
| 269 |
-
"lstrip": false,
|
| 270 |
-
"normalized": false,
|
| 271 |
-
"rstrip": false,
|
| 272 |
-
"single_word": false,
|
| 273 |
-
"special": false
|
| 274 |
-
},
|
| 275 |
-
"154854": {
|
| 276 |
-
"content": "<|image|>",
|
| 277 |
-
"lstrip": false,
|
| 278 |
-
"normalized": false,
|
| 279 |
-
"rstrip": false,
|
| 280 |
-
"single_word": false,
|
| 281 |
-
"special": false
|
| 282 |
-
},
|
| 283 |
-
"154855": {
|
| 284 |
-
"content": "<|video|>",
|
| 285 |
-
"lstrip": false,
|
| 286 |
-
"normalized": false,
|
| 287 |
-
"rstrip": false,
|
| 288 |
-
"single_word": false,
|
| 289 |
-
"special": false
|
| 290 |
-
}
|
| 291 |
-
},
|
| 292 |
-
"additional_special_tokens": [
|
| 293 |
"<|endoftext|>",
|
| 294 |
"[MASK]",
|
| 295 |
"[gMASK]",
|
|
@@ -309,16 +24,12 @@
|
|
| 309 |
"<|begin_of_transcription|>",
|
| 310 |
"<|end_of_transcription|>"
|
| 311 |
],
|
| 312 |
-
"
|
| 313 |
-
"
|
| 314 |
-
"do_lower_case": false,
|
| 315 |
-
"eos_token": "<|endoftext|>",
|
| 316 |
-
"extra_special_tokens": {},
|
| 317 |
-
"model_max_length": 128000,
|
| 318 |
"pad_token": "[MASK]",
|
| 319 |
"padding_side": "left",
|
| 320 |
"remove_space": false,
|
| 321 |
-
"tokenizer_class": "
|
| 322 |
"unk_token": null,
|
| 323 |
"chat_template": "[gMASK]<sop>\n{%- if tools -%}\n<|system|>\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>\n{% for tool in tools %}\n{{ tool | tojson(ensure_ascii=False) }}\n{% endfor %}\n</tools>\n\nFor each function call, output the function name and arguments within the following XML format:\n<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}\n{%- macro visible_text(content) -%}\n {%- if content is string -%}\n {{- content }}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if item is mapping and item.type == 'text' -%}\n {{- item.text }}\n {%- elif item is string -%}\n {{- item }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{- content }}\n {%- endif -%}\n{%- endmacro -%}\n{%- set ns = namespace(last_user_index=-1) %}\n{%- for m in messages %}\n {%- if m.role == 'user' %}\n {% set ns.last_user_index = loop.index0 -%}\n {%- endif %}\n{%- endfor %}\n{% for m in messages %}\n{%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}\n{%- elif m.role == 'assistant' -%}\n<|assistant|>\n{%- set reasoning_content = '' %}\n{%- set content = visible_text(m.content) %}\n{%- if m.reasoning_content is string %}\n {%- set reasoning_content = m.reasoning_content %}\n{%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n{%- endif %}\n{%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content -%}\n{{ '<think>' + reasoning_content.strip() + '</think>'}}\n{%- else -%}\n{{ '</think>' }}\n{%- endif -%}\n{%- if content.strip() -%}\n{{ content.strip() }}\n{%- endif -%}\n{% if m.tool_calls %}\n{% for tc in m.tool_calls %}\n{%- if tc.function %}\n {%- set tc = tc.function %}\n{%- endif %}\n{{- '<tool_call>' + tc.name -}}\n{% set _args = tc.arguments %}{% for k, v in _args.items() %}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{% endfor %}</tool_call>{% endfor %}\n{% endif %}\n{%- elif m.role == 'tool' -%}\n{%- if m.content is string -%}\n{%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|observation|>' }}\n{%- endif %}\n{{- '<tool_response>' }}\n{{- m.content }}\n{{- '</tool_response>' }}\n{%- else -%}\n<|observation|>{% for tr in m.content %}\n<tool_response>{{ tr.output if tr.output is defined else tr }}</tool_response>{% endfor -%}\n{% endif -%}\n{%- elif m.role == 'system' -%}\n<|system|>{{ visible_text(m.content) }}\n{%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n <|assistant|>{{- '</think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}\n{%- endif -%}"
|
| 324 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": null,
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"do_lower_case": false,
|
| 6 |
+
"eos_token": "<|endoftext|>",
|
| 7 |
+
"extra_special_tokens": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
"<|endoftext|>",
|
| 9 |
"[MASK]",
|
| 10 |
"[gMASK]",
|
|
|
|
| 24 |
"<|begin_of_transcription|>",
|
| 25 |
"<|end_of_transcription|>"
|
| 26 |
],
|
| 27 |
+
"is_local": true,
|
| 28 |
+
"model_max_length": 202752,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
"pad_token": "[MASK]",
|
| 30 |
"padding_side": "left",
|
| 31 |
"remove_space": false,
|
| 32 |
+
"tokenizer_class": "TokenizersBackend",
|
| 33 |
"unk_token": null,
|
| 34 |
"chat_template": "[gMASK]<sop>\n{%- if tools -%}\n<|system|>\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>\n{% for tool in tools %}\n{{ tool | tojson(ensure_ascii=False) }}\n{% endfor %}\n</tools>\n\nFor each function call, output the function name and arguments within the following XML format:\n<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}\n{%- macro visible_text(content) -%}\n {%- if content is string -%}\n {{- content }}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if item is mapping and item.type == 'text' -%}\n {{- item.text }}\n {%- elif item is string -%}\n {{- item }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{- content }}\n {%- endif -%}\n{%- endmacro -%}\n{%- set ns = namespace(last_user_index=-1) %}\n{%- for m in messages %}\n {%- if m.role == 'user' %}\n {% set ns.last_user_index = loop.index0 -%}\n {%- endif %}\n{%- endfor %}\n{% for m in messages %}\n{%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}\n{%- elif m.role == 'assistant' -%}\n<|assistant|>\n{%- set reasoning_content = '' %}\n{%- set content = visible_text(m.content) %}\n{%- if m.reasoning_content is string %}\n {%- set reasoning_content = m.reasoning_content %}\n{%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n{%- endif %}\n{%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content -%}\n{{ '<think>' + reasoning_content.strip() + '</think>'}}\n{%- else -%}\n{{ '</think>' }}\n{%- endif -%}\n{%- if content.strip() -%}\n{{ content.strip() }}\n{%- endif -%}\n{% if m.tool_calls %}\n{% for tc in m.tool_calls %}\n{%- if tc.function %}\n {%- set tc = tc.function %}\n{%- endif %}\n{{- '<tool_call>' + tc.name -}}\n{% set _args = tc.arguments %}{% for k, v in _args.items() %}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{% endfor %}</tool_call>{% endfor %}\n{% endif %}\n{%- elif m.role == 'tool' -%}\n{%- if m.content is string -%}\n{%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|observation|>' }}\n{%- endif %}\n{{- '<tool_response>' }}\n{{- m.content }}\n{{- '</tool_response>' }}\n{%- else -%}\n<|observation|>{% for tr in m.content %}\n<tool_response>{{ tr.output if tr.output is defined else tr }}</tool_response>{% endfor -%}\n{% endif -%}\n{%- elif m.role == 'system' -%}\n<|system|>{{ visible_text(m.content) }}\n{%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n <|assistant|>{{- '</think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}\n{%- endif -%}"
|
| 35 |
}
|