hf-transformers-bot commited on
Commit
915ce50
·
verified ·
1 Parent(s): c2af01c

Update tiny models for VideoLlama3Model

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ {%- set identifier = 'im' %}
3
+ {% for message in messages %}
4
+ {% if add_system_prompt and loop.first and message['role'] != 'system' %}
5
+ {{- '<|im_start|>system
6
+ You are VideoLLaMA3 created by Alibaba DAMO Academy, a helpful assistant to help people understand images and videos.<|im_end|>
7
+ ' -}}
8
+ {% endif %}
9
+ {% if message['role'] == 'stream' %}
10
+ {% set identifier = 'stream' %}
11
+ {% else %}
12
+ {% set identifier = 'im' %}
13
+ {% endif %}
14
+ {{- '<|' + identifier + '_start|>' + message['role'] + '
15
+ ' -}}
16
+ {% if message['content'] is string %}
17
+ {{- message['content'] -}}
18
+ {% else %}
19
+ {% for content in message['content'] %}
20
+ {% if content['type'] == 'text' %}
21
+ {{- content['text'] -}}
22
+ {% elif content['type'] == 'image' %}
23
+ {{- '<|image_pad|>' + '
24
+ ' -}}
25
+ {% elif content['type'] == 'video' %}
26
+ {{- '<|video_pad|>' + '
27
+ ' -}}
28
+ {% endif %}
29
+ {% endfor %}
30
+ {% endif %}
31
+ {{- '<|' + identifier + '_end|>' -}}
32
+ {% if identifier != 'stream' %}
33
+ {{- '
34
+ ' -}}
35
+ {% endif %}
36
+ {% endfor %}
37
+ {% if add_generation_prompt %}
38
+ {{- '<|im_start|>assistant
39
+ ' -}}
40
+ {% endif %}
config.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VideoLlama3Model"
4
+ ],
5
+ "dtype": "float32",
6
+ "image_token_id": 3,
7
+ "model_type": "video_llama_3",
8
+ "text_config": {
9
+ "attention_dropout": 0.0,
10
+ "bos_token_id": 0,
11
+ "eos_token_id": 151645,
12
+ "hidden_act": "silu",
13
+ "hidden_size": 32,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 37,
16
+ "layer_types": [
17
+ "full_attention",
18
+ "full_attention"
19
+ ],
20
+ "max_position_embeddings": 512,
21
+ "max_window_layers": 3,
22
+ "model_type": "qwen2",
23
+ "num_attention_heads": 4,
24
+ "num_hidden_layers": 2,
25
+ "num_key_value_heads": 2,
26
+ "pad_token_id": 151643,
27
+ "rms_norm_eps": 1e-06,
28
+ "rope_parameters": {
29
+ "rope_theta": 1000000.0,
30
+ "rope_type": "default"
31
+ },
32
+ "sliding_window": null,
33
+ "tie_word_embeddings": true,
34
+ "use_cache": true,
35
+ "use_sliding_window": false,
36
+ "vocab_size": 151665
37
+ },
38
+ "tie_word_embeddings": true,
39
+ "transformers_version": "5.16.0.dev0",
40
+ "use_token_compression": true,
41
+ "video_token_id": 4,
42
+ "vision_config": {
43
+ "attention_dropout": 0.0,
44
+ "hidden_act": "gelu_pytorch_tanh",
45
+ "hidden_size": 32,
46
+ "initializer_range": 0.02,
47
+ "intermediate_size": 64,
48
+ "layer_norm_eps": 1e-06,
49
+ "model_type": "video_llama_3_vision",
50
+ "num_attention_heads": 4,
51
+ "num_channels": 3,
52
+ "num_hidden_layers": 2,
53
+ "patch_size": 14
54
+ }
55
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3934ffd0dae28c025623c9518d78ede68c509111f6a7f2538b463be8a6d89b37
3
+ size 19627256
preprocessor_config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": true,
3
+ "do_normalize": true,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "image_mean": [
7
+ 0.5,
8
+ 0.5,
9
+ 0.5
10
+ ],
11
+ "image_processor_type": "VideoLlama3ImageProcessor",
12
+ "image_std": [
13
+ 0.5,
14
+ 0.5,
15
+ 0.5
16
+ ],
17
+ "merge_size": 1,
18
+ "patch_size": 14,
19
+ "resample": 3,
20
+ "rescale_factor": 0.00392156862745098,
21
+ "size": {
22
+ "longest_edge": 3211264,
23
+ "shortest_edge": 3136
24
+ },
25
+ "temporal_patch_size": 1
26
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3fd169731d2cbde95e10bf356d66d5997fd885dd8dbb6fb4684da3f23b2585d8
3
+ size 11421892
tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "is_local": true,
9
+ "local_files_only": false,
10
+ "model_max_length": 131072,
11
+ "pad_token": "<|endoftext|>",
12
+ "processor_class": "VideoLlama3Processor",
13
+ "split_special_tokens": false,
14
+ "tokenizer_class": "Qwen2Tokenizer",
15
+ "unk_token": null
16
+ }
video_preprocessor_config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "data_format": "channels_first",
3
+ "default_to_square": true,
4
+ "do_convert_rgb": true,
5
+ "do_normalize": true,
6
+ "do_rescale": true,
7
+ "do_resize": true,
8
+ "do_sample_frames": false,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "max_frames": 180,
20
+ "merge_size": 2,
21
+ "min_frames": 4,
22
+ "patch_size": 14,
23
+ "resample": 3,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "return_metadata": true,
26
+ "size": {
27
+ "longest_edge": 12845056,
28
+ "shortest_edge": 12544
29
+ },
30
+ "temporal_patch_size": 1,
31
+ "use_token_compression": true,
32
+ "video_processor_type": "VideoLlama3VideoProcessor"
33
+ }