1 Commits

Author SHA1 Message Date
e217cf9812 可以像 qwen3 那样加上 /no_think 关闭深思考模式吗 2025-07-02 05:41:44 +00:00
3 changed files with 110 additions and 104 deletions

View File

@ -61,7 +61,7 @@ messages = [
"content": [
{
"type": "image",
"url": "https://model-demo.oss-cn-hangzhou.aliyuncs.com/Grayscale_8bits_palette_sample_image.png"
"url": "https://upload.wikimedia.org/wikipedia/commons/f/fa/Grayscale_8bits_palette_sample_image.png"
},
{
"type": "text",
@ -70,13 +70,12 @@ messages = [
],
}
]
processor = AutoProcessor.from_pretrained(MODEL_PATH, use_fast=True)
model = Glm4vForConditionalGeneration.from_pretrained(
pretrained_model_name_or_path=MODEL_PATH,
torch_dtype=torch.bfloat16,
device_map="auto",
)
processor = AutoProcessor.from_pretrained(MODEL_PATH, use_fast=True)
inputs = processor.apply_chat_template(
messages,
tokenize=True,

View File

@ -22,7 +22,7 @@
"hidden_size": 4096,
"initializer_range": 0.02,
"intermediate_size": 13696,
"max_position_embeddings": 65536,
"max_position_embeddings": 32768,
"num_attention_heads": 32,
"num_hidden_layers": 40,
"num_key_value_heads": 2,

View File

@ -134,7 +134,7 @@
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
"special": true
},
"151346": {
"content": "</think>",
@ -142,7 +142,7 @@
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
"special": true
},
"151347": {
"content": "<answer>",
@ -150,7 +150,7 @@
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
"special": true
},
"151348": {
"content": "</answer>",
@ -158,7 +158,7 @@
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
"special": true
},
"151349": {
"content": "<|begin_of_box|>",
@ -166,7 +166,7 @@
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
"special": true
},
"151350": {
"content": "<|end_of_box|>",
@ -174,7 +174,7 @@
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
"special": true
},
"151351": {
"content": "<|sep|>",
@ -182,7 +182,7 @@
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
"special": true
}
},
"additional_special_tokens": [
@ -200,8 +200,15 @@
"<|end_of_image|>",
"<|begin_of_video|>",
"<|end_of_video|>",
"<|begin_of_box|>",
"<|end_of_box|>",
"<|sep|>",
"<|image|>",
"<|video|>"
"<|video|>",
"<think>",
"</think>",
"<answer>",
"</answer>"
],
"clean_up_tokenization_spaces": false,
"do_lower_case": false,
@ -211,7 +218,7 @@
"input_ids",
"attention_mask"
],
"model_max_length": 65536,
"model_max_length": 64000,
"padding_side": "left",
"remove_space": false,
"tokenizer_class": "PreTrainedTokenizer"