8 Commits

Author SHA1 Message Date
b22fd15b5c 视频推理 2025-07-09 07:58:16 +00:00
5b849bb3a9 Update README.md 2025-07-07 03:27:08 +00:00
ddd07b32b8 set 64000 to 65536 2025-07-03 16:38:32 +08:00
591f89245d update 2025-07-03 16:32:29 +08:00
bc64e132a0 update 2025-07-02 17:01:59 +08:00
b1abac70a1 Merge branch 'master' of https://www.modelscope.cn/ZhipuAI/GLM-4.1V-9B-Thinking 2025-07-02 16:40:32 +08:00
c886823f1d update 2025-07-02 16:40:17 +08:00
c5166d0d5c Update README.md 2025-07-02 07:44:30 +00:00
3 changed files with 104 additions and 110 deletions

View File

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

View File

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

View File

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