yujiepan commited on
Commit
cb1f23f
·
verified ·
1 Parent(s): 486c507

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ pipeline_tag: image-text-to-text
4
+ inference: true
5
+ widget:
6
+ - text: Hello!
7
+ example_title: Hello world
8
+ group: Python
9
+ base_model:
10
+ - openbmb/MiniCPM-V-4
11
+ ---
12
+
13
+ This tiny model is for debugging. It is randomly initialized with the config adapted from [openbmb/MiniCPM-V-4](https://huggingface.co/openbmb/MiniCPM-V-4).
14
+
15
+ ### Example usage:
16
+
17
+ ```python
18
+ import numpy as np
19
+ import torch
20
+ from PIL import Image
21
+ from transformers import AutoModel, AutoTokenizer
22
+
23
+ model_id = "yujiepan/minicpm-v-4-tiny-random"
24
+ model = AutoModel.from_pretrained(model_id, trust_remote_code=True,
25
+ attn_implementation='sdpa', torch_dtype=torch.bfloat16)
26
+ model = model.eval().cuda()
27
+ tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
28
+
29
+ image = Image.fromarray(np.random.randint(0, 255, (224, 224, 3), dtype=np.uint8), 'RGB')
30
+ question = "What is the landform in the picture?"
31
+ msgs = [{'role': 'user', 'content': [image, question]}]
32
+ answer = model.chat(
33
+ msgs=msgs,
34
+ image=image,
35
+ tokenizer=tokenizer,
36
+ max_new_tokens=32,
37
+ )
38
+ print(answer)
39
+
40
+ # Second round chat, pass history context of multi-turn conversation
41
+ msgs.append({"role": "assistant", "content": [answer]})
42
+ msgs.append({"role": "user", "content": [
43
+ "What should I pay attention to when traveling here?"]})
44
+ answer = model.chat(
45
+ msgs=msgs,
46
+ image=None,
47
+ tokenizer=tokenizer,
48
+ max_new_tokens=32,
49
+ )
50
+ print(answer)
51
+ ```
52
+
53
+ ### Codes to create this repo:
54
+
55
+ ```python
56
+ import json
57
+ from pathlib import Path
58
+
59
+ import accelerate
60
+ import torch
61
+ from huggingface_hub import hf_hub_download
62
+ from transformers import (
63
+ AutoConfig,
64
+ AutoModel,
65
+ AutoModelForCausalLM,
66
+ AutoProcessor,
67
+ AutoTokenizer,
68
+ GenerationConfig,
69
+ set_seed,
70
+ )
71
+
72
+ source_model_id = "openbmb/MiniCPM-V-4"
73
+ save_folder = "/tmp/yujiepan/minicpm-v-4-tiny-random"
74
+
75
+ processor = AutoProcessor.from_pretrained(source_model_id, trust_remote_code=True)
76
+ processor.save_pretrained(save_folder)
77
+
78
+ with open(hf_hub_download(source_model_id, filename='config.json', repo_type='model',), 'r', encoding='utf-8') as f:
79
+ config_json = json.load(f)
80
+ for k, v in config_json['auto_map'].items():
81
+ config_json['auto_map'][k] = f'{source_model_id}--{v}'
82
+ automap = config_json['auto_map']
83
+
84
+ config_json['head_dim'] = 32
85
+ config_json["hidden_size"] = 128 # required by Sampler -- num_heads=embed_dim // 128
86
+ config_json['intermediate_size'] = 128
87
+ config_json['num_attention_heads'] = 2
88
+ config_json['num_key_value_heads'] = 1
89
+ config_json['num_hidden_layers'] = 2
90
+ config_json['tie_word_embeddings'] = True
91
+
92
+ factor = config_json['rope_scaling']['long_factor']
93
+ config_json['rope_scaling']['long_factor'] = factor[:16]
94
+ config_json['rope_scaling']['short_factor'] = factor[:16]
95
+
96
+ config_json['vision_config']['intermediate_size'] = 128
97
+ config_json['vision_config']['hidden_size'] = 64
98
+ config_json['vision_config']['num_attention_heads'] = 2
99
+ config_json['vision_config']['num_hidden_layers'] = 2
100
+
101
+ with open(f"{save_folder}/config.json", "w", encoding='utf-8') as f:
102
+ json.dump(config_json, f, indent=2)
103
+
104
+ config = AutoConfig.from_pretrained(
105
+ save_folder,
106
+ trust_remote_code=True,
107
+ )
108
+ print(config)
109
+ torch.set_default_dtype(torch.bfloat16)
110
+ model = AutoModel.from_config(config, trust_remote_code=True)
111
+ torch.set_default_dtype(torch.float32)
112
+ model.generation_config = GenerationConfig.from_pretrained(
113
+ source_model_id, trust_remote_code=True,
114
+ )
115
+ set_seed(42)
116
+ num_params = sum(p.numel() for p in model.parameters())
117
+ with torch.no_grad():
118
+ for name, p in sorted(model.named_parameters()):
119
+ torch.nn.init.normal_(p, 0, 0.1)
120
+ print(name, p.shape, p.dtype, p.device, f'{p.numel() / num_params * 100: .2f}%')
121
+ pass
122
+ model.save_pretrained(save_folder)
123
+
124
+ def modify_automap(path, source_model_id):
125
+ import json
126
+ with open(path, 'r', encoding='utf-8') as f:
127
+ content = json.load(f)
128
+ automap = {}
129
+ if content.get('auto_map', None) is not None:
130
+ for key, value in content.get('auto_map').items():
131
+ if isinstance(value, str):
132
+ value = source_model_id + '--' + value.split('--')[-1]
133
+ else:
134
+ value = [(source_model_id + '--' + v.split('--')[-1]) for v in value]
135
+ automap[key] = value
136
+ with open(path, 'w', encoding='utf-8') as f:
137
+ json.dump({**content, 'auto_map': automap}, f, indent=2)
138
+
139
+ modify_automap(f"{save_folder}/config.json", source_model_id)
140
+ modify_automap(f'{save_folder}/processor_config.json', source_model_id)
141
+ modify_automap(f'{save_folder}/preprocessor_config.json', source_model_id)
142
+ modify_automap(f'{save_folder}/tokenizer_config.json', source_model_id)
143
+ for f in Path(save_folder).glob('*.py'):
144
+ f.unlink()
145
+ ```
added_tokens.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|execute_end|>": 73444,
3
+ "<|execute_start|>": 73443,
4
+ "<|fim_middle|>": 73446,
5
+ "<|fim_prefix|>": 73445,
6
+ "<|fim_suffix|>": 73447,
7
+ "<|im_end|>": 73440,
8
+ "<|im_start|>": 73441,
9
+ "<|tool_call|>": 73442
10
+ }
chat_template.jinja ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {% for message in messages %}{{'<|im_start|>' + message['role'] + '
2
+ ' + message['content'] + '<|im_end|>' + '
3
+ '}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
4
+ ' }}{% endif %}
config.json ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MiniCPMV"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "openbmb/MiniCPM-V-4--configuration_minicpm.MiniCPMVConfig",
9
+ "AutoModel": "openbmb/MiniCPM-V-4--modeling_minicpmv.MiniCPMV",
10
+ "AutoModelForCausalLM": "openbmb/MiniCPM-V-4--modeling_minicpmv.MiniCPMV"
11
+ },
12
+ "batch_vision_input": true,
13
+ "bos_token_id": 1,
14
+ "drop_vision_last_layer": false,
15
+ "eos_token_id": [
16
+ 2,
17
+ 73440
18
+ ],
19
+ "head_dim": 32,
20
+ "hidden_act": "silu",
21
+ "hidden_size": 128,
22
+ "image_size": 448,
23
+ "initializer_range": 0.1,
24
+ "intermediate_size": 128,
25
+ "max_position_embeddings": 32768,
26
+ "mlp_bias": false,
27
+ "model_type": "minicpmv",
28
+ "num_attention_heads": 2,
29
+ "num_hidden_layers": 2,
30
+ "num_key_value_heads": 1,
31
+ "pad_token_id": 2,
32
+ "patch_size": 14,
33
+ "pretraining_tp": 1,
34
+ "query_num": 64,
35
+ "rms_norm_eps": 1e-06,
36
+ "rope_scaling": {
37
+ "factor": 1.0,
38
+ "long_factor": [
39
+ 0.9977997200264581,
40
+ 1.014658295992452,
41
+ 1.0349680404997148,
42
+ 1.059429246056193,
43
+ 1.0888815016813513,
44
+ 1.1243301355211495,
45
+ 1.166977103606075,
46
+ 1.2182568066927284,
47
+ 1.2798772354275727,
48
+ 1.3538666751582975,
49
+ 1.4426259039919596,
50
+ 1.5489853358570191,
51
+ 1.6762658237220625,
52
+ 1.8283407612492941,
53
+ 2.0096956085876183,
54
+ 2.225478927469756
55
+ ],
56
+ "original_max_position_embeddings": 32786,
57
+ "rope_type": "longrope",
58
+ "short_factor": [
59
+ 0.9977997200264581,
60
+ 1.014658295992452,
61
+ 1.0349680404997148,
62
+ 1.059429246056193,
63
+ 1.0888815016813513,
64
+ 1.1243301355211495,
65
+ 1.166977103606075,
66
+ 1.2182568066927284,
67
+ 1.2798772354275727,
68
+ 1.3538666751582975,
69
+ 1.4426259039919596,
70
+ 1.5489853358570191,
71
+ 1.6762658237220625,
72
+ 1.8283407612492941,
73
+ 2.0096956085876183,
74
+ 2.225478927469756
75
+ ]
76
+ },
77
+ "rope_theta": 10000.0,
78
+ "slice_config": {
79
+ "max_slice_nums": 9,
80
+ "model_type": "minicpmv",
81
+ "patch_size": 14,
82
+ "scale_resolution": 448
83
+ },
84
+ "slice_mode": true,
85
+ "tie_word_embeddings": true,
86
+ "torch_dtype": "bfloat16",
87
+ "transformers_version": "4.56.0.dev0",
88
+ "use_cache": true,
89
+ "use_image_id": true,
90
+ "version": 4.0,
91
+ "vision_batch_size": 16,
92
+ "vision_config": {
93
+ "_attn_implementation_autoset": true,
94
+ "attention_dropout": 0.0,
95
+ "hidden_act": "gelu_pytorch_tanh",
96
+ "hidden_size": 64,
97
+ "image_size": 980,
98
+ "intermediate_size": 128,
99
+ "layer_norm_eps": 1e-06,
100
+ "model_type": "siglip_vision_model",
101
+ "num_attention_heads": 2,
102
+ "num_channels": 3,
103
+ "num_hidden_layers": 2,
104
+ "patch_size": 14
105
+ },
106
+ "vocab_size": 73448
107
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": [
5
+ 2,
6
+ 73440
7
+ ],
8
+ "pad_token_id": 2,
9
+ "transformers_version": "4.56.0.dev0"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43d802e3f76813ab008775b4e41e87e6eababc5fc00eccdfa29f7bee8a53ac23
3
+ size 20142264
preprocessor_config.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoImageProcessor": "openbmb/MiniCPM-V-4--image_processing_minicpmv.MiniCPMVImageProcessor",
4
+ "AutoProcessor": "openbmb/MiniCPM-V-4--processing_minicpmv.MiniCPMVProcessor"
5
+ },
6
+ "im_end": "</image>",
7
+ "im_end_token": "</image>",
8
+ "im_id_end": "</image_id>",
9
+ "im_id_start": "<image_id>",
10
+ "im_start": "<image>",
11
+ "im_start_token": "<image>",
12
+ "image_feature_size": 64,
13
+ "image_processor_type": "MiniCPMVImageProcessor",
14
+ "max_slice_nums": 9,
15
+ "mean": [
16
+ 0.5,
17
+ 0.5,
18
+ 0.5
19
+ ],
20
+ "norm_mean": [
21
+ 0.5,
22
+ 0.5,
23
+ 0.5
24
+ ],
25
+ "norm_std": [
26
+ 0.5,
27
+ 0.5,
28
+ 0.5
29
+ ],
30
+ "patch_size": 14,
31
+ "processor_class": "MiniCPMVProcessor",
32
+ "scale_resolution": 448,
33
+ "slice_end": "</slice>",
34
+ "slice_end_token": "</slice>",
35
+ "slice_mode": true,
36
+ "slice_start": "<slice>",
37
+ "slice_start_token": "<slice>",
38
+ "std": [
39
+ 0.5,
40
+ 0.5,
41
+ 0.5
42
+ ],
43
+ "unk": "<unk>",
44
+ "unk_token": "<unk>",
45
+ "use_image_id": true,
46
+ "version": 3.0
47
+ }
processor_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoProcessor": "openbmb/MiniCPM-V-4--processing_minicpmv.MiniCPMVProcessor"
4
+ },
5
+ "processor_class": "MiniCPMVProcessor"
6
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_end|>",
4
+ "<|im_start|>",
5
+ "<|tool_call|>",
6
+ "<|execute_start|>",
7
+ "<|execute_end|>",
8
+ "<|fim_prefix|>",
9
+ "<|fim_middle|>",
10
+ "<|fim_suffix|>"
11
+ ],
12
+ "bos_token": {
13
+ "content": "<s>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false
18
+ },
19
+ "eos_token": {
20
+ "content": "<|im_end|>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<unk>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63099373ce6901674187ba3d7233c5970a253e8e0874056823bf0d3abc8d96a1
3
+ size 1181048
tokenizer_config.json ADDED
@@ -0,0 +1,773 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": null,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ },
30
+ "101": {
31
+ "content": "<image>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": true
37
+ },
38
+ "102": {
39
+ "content": "</image>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": true
45
+ },
46
+ "103": {
47
+ "content": "<ref>",
48
+ "lstrip": false,
49
+ "normalized": false,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": true
53
+ },
54
+ "104": {
55
+ "content": "</ref>",
56
+ "lstrip": false,
57
+ "normalized": false,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": true
61
+ },
62
+ "105": {
63
+ "content": "<box>",
64
+ "lstrip": false,
65
+ "normalized": false,
66
+ "rstrip": false,
67
+ "single_word": false,
68
+ "special": true
69
+ },
70
+ "106": {
71
+ "content": "</box>",
72
+ "lstrip": false,
73
+ "normalized": false,
74
+ "rstrip": false,
75
+ "single_word": false,
76
+ "special": true
77
+ },
78
+ "107": {
79
+ "content": "<quad>",
80
+ "lstrip": false,
81
+ "normalized": false,
82
+ "rstrip": false,
83
+ "single_word": false,
84
+ "special": true
85
+ },
86
+ "108": {
87
+ "content": "</quad>",
88
+ "lstrip": false,
89
+ "normalized": false,
90
+ "rstrip": false,
91
+ "single_word": false,
92
+ "special": true
93
+ },
94
+ "109": {
95
+ "content": "<point>",
96
+ "lstrip": false,
97
+ "normalized": false,
98
+ "rstrip": false,
99
+ "single_word": false,
100
+ "special": true
101
+ },
102
+ "110": {
103
+ "content": "</point>",
104
+ "lstrip": false,
105
+ "normalized": false,
106
+ "rstrip": false,
107
+ "single_word": false,
108
+ "special": true
109
+ },
110
+ "111": {
111
+ "content": "<slice>",
112
+ "lstrip": false,
113
+ "normalized": false,
114
+ "rstrip": false,
115
+ "single_word": false,
116
+ "special": true
117
+ },
118
+ "112": {
119
+ "content": "</slice>",
120
+ "lstrip": false,
121
+ "normalized": false,
122
+ "rstrip": false,
123
+ "single_word": false,
124
+ "special": true
125
+ },
126
+ "113": {
127
+ "content": "<image_id>",
128
+ "lstrip": false,
129
+ "normalized": false,
130
+ "rstrip": false,
131
+ "single_word": false,
132
+ "special": true
133
+ },
134
+ "114": {
135
+ "content": "</image_id>",
136
+ "lstrip": false,
137
+ "normalized": false,
138
+ "rstrip": false,
139
+ "single_word": false,
140
+ "special": true
141
+ },
142
+ "115": {
143
+ "content": "<unit>",
144
+ "lstrip": false,
145
+ "normalized": false,
146
+ "rstrip": false,
147
+ "single_word": false,
148
+ "special": true
149
+ },
150
+ "116": {
151
+ "content": "</unit>",
152
+ "lstrip": false,
153
+ "normalized": false,
154
+ "rstrip": false,
155
+ "single_word": false,
156
+ "special": true
157
+ },
158
+ "117": {
159
+ "content": "<think>",
160
+ "lstrip": false,
161
+ "normalized": false,
162
+ "rstrip": false,
163
+ "single_word": false,
164
+ "special": true
165
+ },
166
+ "118": {
167
+ "content": "</think>",
168
+ "lstrip": false,
169
+ "normalized": false,
170
+ "rstrip": false,
171
+ "single_word": false,
172
+ "special": true
173
+ },
174
+ "119": {
175
+ "content": "<answer>",
176
+ "lstrip": false,
177
+ "normalized": false,
178
+ "rstrip": false,
179
+ "single_word": false,
180
+ "special": true
181
+ },
182
+ "120": {
183
+ "content": "</answer>",
184
+ "lstrip": false,
185
+ "normalized": false,
186
+ "rstrip": false,
187
+ "single_word": false,
188
+ "special": true
189
+ },
190
+ "121": {
191
+ "content": "<focus>",
192
+ "lstrip": false,
193
+ "normalized": false,
194
+ "rstrip": false,
195
+ "single_word": false,
196
+ "special": true
197
+ },
198
+ "122": {
199
+ "content": "</focus>",
200
+ "lstrip": false,
201
+ "normalized": false,
202
+ "rstrip": false,
203
+ "single_word": false,
204
+ "special": true
205
+ },
206
+ "123": {
207
+ "content": "<line>",
208
+ "lstrip": false,
209
+ "normalized": false,
210
+ "rstrip": false,
211
+ "single_word": false,
212
+ "special": true
213
+ },
214
+ "124": {
215
+ "content": "</line>",
216
+ "lstrip": false,
217
+ "normalized": false,
218
+ "rstrip": false,
219
+ "single_word": false,
220
+ "special": true
221
+ },
222
+ "125": {
223
+ "content": "<perception>",
224
+ "lstrip": false,
225
+ "normalized": false,
226
+ "rstrip": false,
227
+ "single_word": false,
228
+ "special": true
229
+ },
230
+ "126": {
231
+ "content": "</perception>",
232
+ "lstrip": false,
233
+ "normalized": false,
234
+ "rstrip": false,
235
+ "single_word": false,
236
+ "special": true
237
+ },
238
+ "127": {
239
+ "content": "<source_image>",
240
+ "lstrip": false,
241
+ "normalized": false,
242
+ "rstrip": false,
243
+ "single_word": false,
244
+ "special": true
245
+ },
246
+ "128": {
247
+ "content": "</source_image>",
248
+ "lstrip": false,
249
+ "normalized": false,
250
+ "rstrip": false,
251
+ "single_word": false,
252
+ "special": true
253
+ },
254
+ "129": {
255
+ "content": "<image_save_to>",
256
+ "lstrip": false,
257
+ "normalized": false,
258
+ "rstrip": false,
259
+ "single_word": false,
260
+ "special": true
261
+ },
262
+ "130": {
263
+ "content": "</image_save_to>",
264
+ "lstrip": false,
265
+ "normalized": false,
266
+ "rstrip": false,
267
+ "single_word": false,
268
+ "special": true
269
+ },
270
+ "131": {
271
+ "content": "<|audio_start|>",
272
+ "lstrip": false,
273
+ "normalized": false,
274
+ "rstrip": false,
275
+ "single_word": false,
276
+ "special": true
277
+ },
278
+ "132": {
279
+ "content": "<|audio|>",
280
+ "lstrip": false,
281
+ "normalized": false,
282
+ "rstrip": false,
283
+ "single_word": false,
284
+ "special": true
285
+ },
286
+ "133": {
287
+ "content": "<|audio_end|>",
288
+ "lstrip": false,
289
+ "normalized": false,
290
+ "rstrip": false,
291
+ "single_word": false,
292
+ "special": true
293
+ },
294
+ "134": {
295
+ "content": "<|spk_bos|>",
296
+ "lstrip": false,
297
+ "normalized": false,
298
+ "rstrip": false,
299
+ "single_word": false,
300
+ "special": true
301
+ },
302
+ "135": {
303
+ "content": "<|spk|>",
304
+ "lstrip": false,
305
+ "normalized": false,
306
+ "rstrip": false,
307
+ "single_word": false,
308
+ "special": true
309
+ },
310
+ "136": {
311
+ "content": "<|spk_eos|>",
312
+ "lstrip": false,
313
+ "normalized": false,
314
+ "rstrip": false,
315
+ "single_word": false,
316
+ "special": true
317
+ },
318
+ "137": {
319
+ "content": "<|tts_bos|>",
320
+ "lstrip": false,
321
+ "normalized": false,
322
+ "rstrip": false,
323
+ "single_word": false,
324
+ "special": true
325
+ },
326
+ "138": {
327
+ "content": "<|tts_eos|>",
328
+ "lstrip": false,
329
+ "normalized": false,
330
+ "rstrip": false,
331
+ "single_word": false,
332
+ "special": true
333
+ },
334
+ "139": {
335
+ "content": "<|listen|>",
336
+ "lstrip": false,
337
+ "normalized": false,
338
+ "rstrip": false,
339
+ "single_word": false,
340
+ "special": true
341
+ },
342
+ "140": {
343
+ "content": "<|speak|>",
344
+ "lstrip": false,
345
+ "normalized": false,
346
+ "rstrip": false,
347
+ "single_word": false,
348
+ "special": true
349
+ },
350
+ "141": {
351
+ "content": "<|interrupt|>",
352
+ "lstrip": false,
353
+ "normalized": false,
354
+ "rstrip": false,
355
+ "single_word": false,
356
+ "special": true
357
+ },
358
+ "142": {
359
+ "content": "<|vad_start|>",
360
+ "lstrip": false,
361
+ "normalized": false,
362
+ "rstrip": false,
363
+ "single_word": false,
364
+ "special": true
365
+ },
366
+ "143": {
367
+ "content": "<|vad_end|>",
368
+ "lstrip": false,
369
+ "normalized": false,
370
+ "rstrip": false,
371
+ "single_word": false,
372
+ "special": true
373
+ },
374
+ "144": {
375
+ "content": "<|emotion_start|>",
376
+ "lstrip": false,
377
+ "normalized": false,
378
+ "rstrip": false,
379
+ "single_word": false,
380
+ "special": true
381
+ },
382
+ "145": {
383
+ "content": "<|emotion_end|>",
384
+ "lstrip": false,
385
+ "normalized": false,
386
+ "rstrip": false,
387
+ "single_word": false,
388
+ "special": true
389
+ },
390
+ "146": {
391
+ "content": "<|speed_start|>",
392
+ "lstrip": false,
393
+ "normalized": false,
394
+ "rstrip": false,
395
+ "single_word": false,
396
+ "special": true
397
+ },
398
+ "147": {
399
+ "content": "<|speed_end|>",
400
+ "lstrip": false,
401
+ "normalized": false,
402
+ "rstrip": false,
403
+ "single_word": false,
404
+ "special": true
405
+ },
406
+ "148": {
407
+ "content": "<|pitch_start|>",
408
+ "lstrip": false,
409
+ "normalized": false,
410
+ "rstrip": false,
411
+ "single_word": false,
412
+ "special": true
413
+ },
414
+ "149": {
415
+ "content": "<|pitch_end|>",
416
+ "lstrip": false,
417
+ "normalized": false,
418
+ "rstrip": false,
419
+ "single_word": false,
420
+ "special": true
421
+ },
422
+ "150": {
423
+ "content": "<|timbre_0|>",
424
+ "lstrip": false,
425
+ "normalized": false,
426
+ "rstrip": false,
427
+ "single_word": false,
428
+ "special": true
429
+ },
430
+ "151": {
431
+ "content": "<|timbre_1|>",
432
+ "lstrip": false,
433
+ "normalized": false,
434
+ "rstrip": false,
435
+ "single_word": false,
436
+ "special": true
437
+ },
438
+ "152": {
439
+ "content": "<|timbre_2|>",
440
+ "lstrip": false,
441
+ "normalized": false,
442
+ "rstrip": false,
443
+ "single_word": false,
444
+ "special": true
445
+ },
446
+ "153": {
447
+ "content": "<|timbre_3|>",
448
+ "lstrip": false,
449
+ "normalized": false,
450
+ "rstrip": false,
451
+ "single_word": false,
452
+ "special": true
453
+ },
454
+ "154": {
455
+ "content": "<|timbre_4|>",
456
+ "lstrip": false,
457
+ "normalized": false,
458
+ "rstrip": false,
459
+ "single_word": false,
460
+ "special": true
461
+ },
462
+ "155": {
463
+ "content": "<|timbre_5|>",
464
+ "lstrip": false,
465
+ "normalized": false,
466
+ "rstrip": false,
467
+ "single_word": false,
468
+ "special": true
469
+ },
470
+ "156": {
471
+ "content": "<|timbre_6|>",
472
+ "lstrip": false,
473
+ "normalized": false,
474
+ "rstrip": false,
475
+ "single_word": false,
476
+ "special": true
477
+ },
478
+ "157": {
479
+ "content": "<|timbre_7|>",
480
+ "lstrip": false,
481
+ "normalized": false,
482
+ "rstrip": false,
483
+ "single_word": false,
484
+ "special": true
485
+ },
486
+ "158": {
487
+ "content": "<|timbre_8|>",
488
+ "lstrip": false,
489
+ "normalized": false,
490
+ "rstrip": false,
491
+ "single_word": false,
492
+ "special": true
493
+ },
494
+ "159": {
495
+ "content": "<|timbre_9|>",
496
+ "lstrip": false,
497
+ "normalized": false,
498
+ "rstrip": false,
499
+ "single_word": false,
500
+ "special": true
501
+ },
502
+ "160": {
503
+ "content": "<|timbre_10|>",
504
+ "lstrip": false,
505
+ "normalized": false,
506
+ "rstrip": false,
507
+ "single_word": false,
508
+ "special": true
509
+ },
510
+ "161": {
511
+ "content": "<|timbre_11|>",
512
+ "lstrip": false,
513
+ "normalized": false,
514
+ "rstrip": false,
515
+ "single_word": false,
516
+ "special": true
517
+ },
518
+ "162": {
519
+ "content": "<|timbre_12|>",
520
+ "lstrip": false,
521
+ "normalized": false,
522
+ "rstrip": false,
523
+ "single_word": false,
524
+ "special": true
525
+ },
526
+ "163": {
527
+ "content": "<|timbre_13|>",
528
+ "lstrip": false,
529
+ "normalized": false,
530
+ "rstrip": false,
531
+ "single_word": false,
532
+ "special": true
533
+ },
534
+ "164": {
535
+ "content": "<|timbre_14|>",
536
+ "lstrip": false,
537
+ "normalized": false,
538
+ "rstrip": false,
539
+ "single_word": false,
540
+ "special": true
541
+ },
542
+ "165": {
543
+ "content": "<|timbre_15|>",
544
+ "lstrip": false,
545
+ "normalized": false,
546
+ "rstrip": false,
547
+ "single_word": false,
548
+ "special": true
549
+ },
550
+ "166": {
551
+ "content": "<|timbre_16|>",
552
+ "lstrip": false,
553
+ "normalized": false,
554
+ "rstrip": false,
555
+ "single_word": false,
556
+ "special": true
557
+ },
558
+ "167": {
559
+ "content": "<|timbre_17|>",
560
+ "lstrip": false,
561
+ "normalized": false,
562
+ "rstrip": false,
563
+ "single_word": false,
564
+ "special": true
565
+ },
566
+ "168": {
567
+ "content": "<|timbre_18|>",
568
+ "lstrip": false,
569
+ "normalized": false,
570
+ "rstrip": false,
571
+ "single_word": false,
572
+ "special": true
573
+ },
574
+ "169": {
575
+ "content": "<|timbre_19|>",
576
+ "lstrip": false,
577
+ "normalized": false,
578
+ "rstrip": false,
579
+ "single_word": false,
580
+ "special": true
581
+ },
582
+ "170": {
583
+ "content": "<|timbre_20|>",
584
+ "lstrip": false,
585
+ "normalized": false,
586
+ "rstrip": false,
587
+ "single_word": false,
588
+ "special": true
589
+ },
590
+ "171": {
591
+ "content": "<|timbre_21|>",
592
+ "lstrip": false,
593
+ "normalized": false,
594
+ "rstrip": false,
595
+ "single_word": false,
596
+ "special": true
597
+ },
598
+ "172": {
599
+ "content": "<|timbre_22|>",
600
+ "lstrip": false,
601
+ "normalized": false,
602
+ "rstrip": false,
603
+ "single_word": false,
604
+ "special": true
605
+ },
606
+ "173": {
607
+ "content": "<|timbre_23|>",
608
+ "lstrip": false,
609
+ "normalized": false,
610
+ "rstrip": false,
611
+ "single_word": false,
612
+ "special": true
613
+ },
614
+ "174": {
615
+ "content": "<|timbre_24|>",
616
+ "lstrip": false,
617
+ "normalized": false,
618
+ "rstrip": false,
619
+ "single_word": false,
620
+ "special": true
621
+ },
622
+ "175": {
623
+ "content": "<|timbre_25|>",
624
+ "lstrip": false,
625
+ "normalized": false,
626
+ "rstrip": false,
627
+ "single_word": false,
628
+ "special": true
629
+ },
630
+ "176": {
631
+ "content": "<|timbre_26|>",
632
+ "lstrip": false,
633
+ "normalized": false,
634
+ "rstrip": false,
635
+ "single_word": false,
636
+ "special": true
637
+ },
638
+ "177": {
639
+ "content": "<|timbre_27|>",
640
+ "lstrip": false,
641
+ "normalized": false,
642
+ "rstrip": false,
643
+ "single_word": false,
644
+ "special": true
645
+ },
646
+ "178": {
647
+ "content": "<|timbre_28|>",
648
+ "lstrip": false,
649
+ "normalized": false,
650
+ "rstrip": false,
651
+ "single_word": false,
652
+ "special": true
653
+ },
654
+ "179": {
655
+ "content": "<|timbre_29|>",
656
+ "lstrip": false,
657
+ "normalized": false,
658
+ "rstrip": false,
659
+ "single_word": false,
660
+ "special": true
661
+ },
662
+ "180": {
663
+ "content": "<|timbre_30|>",
664
+ "lstrip": false,
665
+ "normalized": false,
666
+ "rstrip": false,
667
+ "single_word": false,
668
+ "special": true
669
+ },
670
+ "181": {
671
+ "content": "<|timbre_31|>",
672
+ "lstrip": false,
673
+ "normalized": false,
674
+ "rstrip": false,
675
+ "single_word": false,
676
+ "special": true
677
+ },
678
+ "73440": {
679
+ "content": "<|im_end|>",
680
+ "lstrip": false,
681
+ "normalized": false,
682
+ "rstrip": false,
683
+ "single_word": false,
684
+ "special": true
685
+ },
686
+ "73441": {
687
+ "content": "<|im_start|>",
688
+ "lstrip": false,
689
+ "normalized": false,
690
+ "rstrip": false,
691
+ "single_word": false,
692
+ "special": true
693
+ },
694
+ "73442": {
695
+ "content": "<|tool_call|>",
696
+ "lstrip": false,
697
+ "normalized": false,
698
+ "rstrip": false,
699
+ "single_word": false,
700
+ "special": true
701
+ },
702
+ "73443": {
703
+ "content": "<|execute_start|>",
704
+ "lstrip": false,
705
+ "normalized": false,
706
+ "rstrip": false,
707
+ "single_word": false,
708
+ "special": true
709
+ },
710
+ "73444": {
711
+ "content": "<|execute_end|>",
712
+ "lstrip": false,
713
+ "normalized": false,
714
+ "rstrip": false,
715
+ "single_word": false,
716
+ "special": true
717
+ },
718
+ "73445": {
719
+ "content": "<|fim_prefix|>",
720
+ "lstrip": false,
721
+ "normalized": false,
722
+ "rstrip": false,
723
+ "single_word": false,
724
+ "special": true
725
+ },
726
+ "73446": {
727
+ "content": "<|fim_middle|>",
728
+ "lstrip": false,
729
+ "normalized": false,
730
+ "rstrip": false,
731
+ "single_word": false,
732
+ "special": true
733
+ },
734
+ "73447": {
735
+ "content": "<|fim_suffix|>",
736
+ "lstrip": false,
737
+ "normalized": false,
738
+ "rstrip": false,
739
+ "single_word": false,
740
+ "special": true
741
+ }
742
+ },
743
+ "additional_special_tokens": [
744
+ "<|im_end|>",
745
+ "<|im_start|>",
746
+ "<|tool_call|>",
747
+ "<|execute_start|>",
748
+ "<|execute_end|>",
749
+ "<|fim_prefix|>",
750
+ "<|fim_middle|>",
751
+ "<|fim_suffix|>"
752
+ ],
753
+ "auto_map": {
754
+ "AutoProcessor": "openbmb/MiniCPM-V-4--processing_minicpmv.MiniCPMVProcessor",
755
+ "AutoTokenizer": [
756
+ "openbmb/MiniCPM-V-4--tokenization_llama.LlamaTokenizer",
757
+ "openbmb/MiniCPM-V-4--tokenization_minicpmv_fast.MiniCPMVTokenizerFast"
758
+ ]
759
+ },
760
+ "bos_token": "<s>",
761
+ "clean_up_tokenization_spaces": false,
762
+ "eos_token": "<|im_end|>",
763
+ "extra_special_tokens": {},
764
+ "legacy": true,
765
+ "model_max_length": 1000000000000000019884624838656,
766
+ "pad_token": null,
767
+ "processor_class": "MiniCPMVProcessor",
768
+ "sp_model_kwargs": {},
769
+ "spaces_between_special_tokens": false,
770
+ "tokenizer_class": "MiniCPMVTokenizer",
771
+ "unk_token": "<unk>",
772
+ "use_default_system_prompt": false
773
+ }