mirror of
https://www.modelscope.cn/ZhipuAI/GLM-4.1V-9B-Thinking.git
synced 2026-06-12 12:12:53 +08:00
Compare commits
8 Commits
pr/chadqiu
...
pr/DX12388
| Author | SHA1 | Date | |
|---|---|---|---|
| b22fd15b5c | |||
| 5b849bb3a9 | |||
| ddd07b32b8 | |||
| 591f89245d | |||
| bc64e132a0 | |||
| b1abac70a1 | |||
| c886823f1d | |||
| c5166d0d5c |
@ -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,
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user