Zhengrongzz commited on
Commit
f0e74be
·
verified ·
1 Parent(s): d0ea361

Upload 4 files

Browse files
Files changed (3) hide show
  1. chat_template.json +3 -0
  2. config.json +63 -200
  3. processor_config.json +7 -3
chat_template.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "chat_template": "{% for message in messages %}{% if message['role'] != 'system' %}{{ message['role'].upper() + ': '}}{% endif %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>\n' }}{% endfor %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'video') %}{{ '<video>\n' }}{% endfor %}{# Render all text next #}{% if message['role'] != 'assistant' %}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ content['text'] + ' '}}{% endfor %}{% else %}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{% generation %}{{ content['text'] + ' '}}{% endgeneration %}{% endfor %}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'ASSISTANT:' }}{% endif %}"
3
+ }
config.json CHANGED
@@ -1,206 +1,69 @@
1
  {
2
- "_name_or_path": "/root/models/LLaVA-NeXT-Video-7B",
3
- "architectures": [
4
- "LlavaNextVideoForConditionalGeneration"
5
- ],
6
- "ignore_index": -100,
7
- "image_grid_pinpoints": [
8
- [
9
- 336,
10
- 672
11
- ],
12
- [
13
- 672,
14
- 336
15
- ],
16
- [
17
- 672,
18
- 672
19
- ],
20
- [
21
- 1008,
22
- 336
23
- ],
24
- [
25
- 336,
26
- 1008
27
- ]
28
- ],
29
- "image_token_index": 32001,
30
- "model_type": "llava_next_video",
31
- "projector_hidden_act": "gelu",
32
- "spatial_pool_mode": "average",
33
- "spatial_pool_out_channels": 1024,
34
- "spatial_pool_stride": 2,
35
- "text_config": {
36
- "_name_or_path": "lmsys/vicuna-7b-v1.5",
37
- "add_cross_attention": false,
38
  "architectures": [
39
- "LlamaForCausalLM"
40
  ],
41
- "attention_bias": false,
42
- "attention_dropout": 0.0,
43
- "bad_words_ids": null,
44
- "begin_suppress_tokens": null,
45
- "bos_token_id": 1,
46
- "chunk_size_feed_forward": 0,
47
- "cross_attention_hidden_size": null,
48
- "decoder_start_token_id": null,
49
- "diversity_penalty": 0.0,
50
- "do_sample": false,
51
- "early_stopping": false,
52
- "encoder_no_repeat_ngram_size": 0,
53
- "eos_token_id": 2,
54
- "exponential_decay_length_penalty": null,
55
- "finetuning_task": null,
56
- "forced_bos_token_id": null,
57
- "forced_eos_token_id": null,
58
- "hidden_act": "silu",
59
- "hidden_size": 4096,
60
- "id2label": {
61
- "0": "LABEL_0",
62
- "1": "LABEL_1"
63
- },
64
- "initializer_range": 0.02,
65
- "intermediate_size": 11008,
66
- "is_decoder": false,
67
- "is_encoder_decoder": false,
68
- "label2id": {
69
- "LABEL_0": 0,
70
- "LABEL_1": 1
71
- },
72
- "length_penalty": 1.0,
73
- "max_length": 20,
74
- "max_position_embeddings": 4096,
75
- "min_length": 0,
76
- "mlp_bias": false,
77
- "model_type": "llama",
78
- "no_repeat_ngram_size": 0,
79
- "num_attention_heads": 32,
80
- "num_beam_groups": 1,
81
- "num_beams": 1,
82
- "num_hidden_layers": 32,
83
- "num_key_value_heads": 32,
84
- "num_return_sequences": 1,
85
- "output_attentions": false,
86
- "output_hidden_states": false,
87
- "output_scores": false,
88
- "pad_token_id": 0,
89
- "prefix": null,
90
- "pretraining_tp": 1,
91
- "problem_type": null,
92
- "pruned_heads": {},
93
- "remove_invalid_values": false,
94
- "repetition_penalty": 1.0,
95
- "return_dict": true,
96
- "return_dict_in_generate": false,
97
- "rms_norm_eps": 1e-05,
98
- "rope_scaling": {
99
- "factor": 2.5,
100
- "type": "linear"
101
  },
102
- "rope_theta": 10000.0,
103
- "sep_token_id": null,
104
- "suppress_tokens": null,
105
- "task_specific_params": null,
106
- "temperature": 1.0,
107
- "tf_legacy_loss": false,
108
- "tie_encoder_decoder": false,
109
  "tie_word_embeddings": false,
110
- "tokenizer_class": null,
111
- "top_k": 50,
112
- "top_p": 1.0,
113
- "torch_dtype": "float16",
114
- "torchscript": false,
115
- "type": "linear",
116
- "typical_p": 1.0,
117
- "use_bfloat16": false,
118
- "use_cache": true,
119
- "vocab_size": 32064
120
- },
121
- "tie_word_embeddings": false,
122
- "torch_dtype": "bfloat16",
123
- "transformers_version": "4.43.0.dev0",
124
- "use_cache": false,
125
- "use_image_newline_parameter": true,
126
- "video_token_index": 32000,
127
- "vision_config": {
128
- "_name_or_path": "",
129
- "add_cross_attention": false,
130
- "architectures": null,
131
- "attention_dropout": 0.0,
132
- "bad_words_ids": null,
133
- "begin_suppress_tokens": null,
134
- "bos_token_id": null,
135
- "chunk_size_feed_forward": 0,
136
- "cross_attention_hidden_size": null,
137
- "decoder_start_token_id": null,
138
- "diversity_penalty": 0.0,
139
- "do_sample": false,
140
- "early_stopping": false,
141
- "encoder_no_repeat_ngram_size": 0,
142
- "eos_token_id": null,
143
- "exponential_decay_length_penalty": null,
144
- "finetuning_task": null,
145
- "forced_bos_token_id": null,
146
- "forced_eos_token_id": null,
147
- "hidden_act": "quick_gelu",
148
- "hidden_size": 1024,
149
- "id2label": {
150
- "0": "LABEL_0",
151
- "1": "LABEL_1"
152
- },
153
- "image_size": 336,
154
- "initializer_factor": 1.0,
155
- "initializer_range": 0.02,
156
- "intermediate_size": 4096,
157
- "is_decoder": false,
158
- "is_encoder_decoder": false,
159
- "label2id": {
160
- "LABEL_0": 0,
161
- "LABEL_1": 1
162
  },
163
- "layer_norm_eps": 1e-05,
164
- "length_penalty": 1.0,
165
- "max_length": 20,
166
- "min_length": 0,
167
- "model_type": "clip_vision_model",
168
- "no_repeat_ngram_size": 0,
169
- "num_attention_heads": 16,
170
- "num_beam_groups": 1,
171
- "num_beams": 1,
172
- "num_channels": 3,
173
- "num_hidden_layers": 24,
174
- "num_return_sequences": 1,
175
- "output_attentions": false,
176
- "output_hidden_states": false,
177
- "output_scores": false,
178
- "pad_token_id": null,
179
- "patch_size": 14,
180
- "prefix": null,
181
- "problem_type": null,
182
- "projection_dim": 768,
183
- "pruned_heads": {},
184
- "remove_invalid_values": false,
185
- "repetition_penalty": 1.0,
186
- "return_dict": true,
187
- "return_dict_in_generate": false,
188
- "sep_token_id": null,
189
- "suppress_tokens": null,
190
- "task_specific_params": null,
191
- "temperature": 1.0,
192
- "tf_legacy_loss": false,
193
- "tie_encoder_decoder": false,
194
- "tie_word_embeddings": true,
195
- "tokenizer_class": null,
196
- "top_k": 50,
197
- "top_p": 1.0,
198
- "torch_dtype": null,
199
- "torchscript": false,
200
- "typical_p": 1.0,
201
- "use_bfloat16": false,
202
- "vocab_size": 32000
203
- },
204
- "vision_feature_layer": -2,
205
- "vision_feature_select_strategy": "default"
206
- }
 
1
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  "architectures": [
3
+ "LlavaNextVideoForConditionalGeneration"
4
  ],
5
+ "ignore_index": -100,
6
+ "image_grid_pinpoints": [
7
+ [
8
+ 336,
9
+ 672
10
+ ],
11
+ [
12
+ 672,
13
+ 336
14
+ ],
15
+ [
16
+ 672,
17
+ 672
18
+ ],
19
+ [
20
+ 1008,
21
+ 336
22
+ ],
23
+ [
24
+ 336,
25
+ 1008
26
+ ]
27
+ ],
28
+ "image_token_index": 32001,
29
+ "model_type": "llava_next_video",
30
+ "projector_hidden_act": "gelu",
31
+ "spatial_pool_mode": "average",
32
+ "spatial_pool_out_channels": 1024,
33
+ "spatial_pool_stride": 2,
34
+ "text_config": {
35
+ "_name_or_path": "lmsys/vicuna-7b-v1.5",
36
+ "architectures": [
37
+ "LlamaForCausalLM"
38
+ ],
39
+ "rope_scaling" : {
40
+ "factor": 2.5,
41
+ "type": "linear"
42
+ },
43
+ "max_position_embeddings": 4096,
44
+ "model_type": "llama",
45
+ "pad_token_id": 0,
46
+ "rms_norm_eps": 1e-05,
47
+ "torch_dtype": "float16",
48
+ "type": "linear",
49
+ "vocab_size": 32064
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  },
 
 
 
 
 
 
 
51
  "tie_word_embeddings": false,
52
+ "torch_dtype": "bfloat16",
53
+ "transformers_version": "4.42.0.dev0",
54
+ "use_image_newline_parameter": true,
55
+ "video_token_index": 32000,
56
+ "vision_config": {
57
+ "hidden_size": 1024,
58
+ "image_size": 336,
59
+ "intermediate_size": 4096,
60
+ "model_type": "clip_vision_model",
61
+ "num_attention_heads": 16,
62
+ "num_hidden_layers": 24,
63
+ "patch_size": 14,
64
+ "projection_dim": 768,
65
+ "vocab_size": 32000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  },
67
+ "vision_feature_layer": -2,
68
+ "vision_feature_select_strategy": "default"
69
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
processor_config.json CHANGED
@@ -1,4 +1,8 @@
1
  {
2
- "chat_template": "{% for message in messages %}{% if message['role'] == 'system' %}{{ message['content'][0]['text'] }}{% else %}{{ message['role'].upper() + ': '}}{% endif %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>\n' }}{% endfor %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'video') %}{{ '<video>\n' }}{% endfor %}{# Render all text next #}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ content['text'] + ' '}}{% endfor %}{% endfor %}{% if add_generation_prompt %}{{ 'ASSISTANT:' }}{% endif %}",
3
- "processor_class": "LlavaNextVideoProcessor"
4
- }
 
 
 
 
 
1
  {
2
+ "image_token": "<image>",
3
+ "video_token": "<video>",
4
+ "num_additional_image_tokens": 1,
5
+ "patch_size": 14,
6
+ "processor_class": "LlavaNextVideoProcessor",
7
+ "vision_feature_select_strategy": "default"
8
+ }