hf-transformers-bot commited on
Commit
b371a0f
·
verified ·
1 Parent(s): de6ade7

Update tiny models for InternVLModel

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,6 @@
 
 
 
 
 
 
 
1
+ {% for message in messages %}{{'<|im_start|>' + message['role'] + '
2
+ '}}{% if message['content'] is string %}{{ message['content'] }}{% else %}{% for content in message['content'] %}{% if content['type'] == 'image' %}{{ '<IMG_CONTEXT>
3
+ ' }}{% elif content['type'] == 'video' %}{{ '<video>
4
+ ' }}{% elif content['type'] == 'text' %}{{ content['text'] }}{% endif %}{% endfor %}{% endif %}{{'<|im_end|>
5
+ '}}{% endfor %}{% if add_generation_prompt %}{{'<|im_start|>assistant
6
+ ' }}{% endif %}
config.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "InternVLModel"
4
+ ],
5
+ "downsample_ratio": 0.5,
6
+ "dtype": "float32",
7
+ "image_seq_length": 64,
8
+ "image_token_id": 1,
9
+ "model_type": "internvl",
10
+ "projector_hidden_act": "gelu",
11
+ "text_config": {
12
+ "attention_dropout": 0.0,
13
+ "bos_token_id": 3,
14
+ "eos_token_id": 151645,
15
+ "hidden_act": "silu",
16
+ "hidden_size": 128,
17
+ "initializer_range": 0.02,
18
+ "intermediate_size": 37,
19
+ "layer_types": [
20
+ "full_attention",
21
+ "full_attention"
22
+ ],
23
+ "max_position_embeddings": 512,
24
+ "max_window_layers": 28,
25
+ "mlp_ratio": 4,
26
+ "model_type": "qwen2",
27
+ "num_attention_heads": 4,
28
+ "num_hidden_layers": 2,
29
+ "num_key_value_heads": 2,
30
+ "output_channels": 64,
31
+ "pad_token_id": 151643,
32
+ "rms_norm_eps": 1e-06,
33
+ "rope_parameters": {
34
+ "rope_theta": 10000,
35
+ "rope_type": "default"
36
+ },
37
+ "sliding_window": null,
38
+ "tie_word_embeddings": true,
39
+ "use_cache": true,
40
+ "use_sliding_window": false,
41
+ "vocab_size": 151675
42
+ },
43
+ "tie_word_embeddings": true,
44
+ "transformers_version": "5.16.0.dev0",
45
+ "vision_config": {
46
+ "attention_bias": false,
47
+ "attention_dropout": 0.0,
48
+ "hidden_act": "quick_gelu",
49
+ "hidden_dropout_prob": 0.0,
50
+ "hidden_size": 32,
51
+ "image_size": [
52
+ 64,
53
+ 64
54
+ ],
55
+ "initializer_range": 0.02,
56
+ "intermediate_size": 128,
57
+ "layer_norm_eps": 1e-06,
58
+ "layer_scale_init_value": 0.1,
59
+ "model_type": "internvl_vision",
60
+ "norm_type": "layer_norm",
61
+ "num_attention_heads": 4,
62
+ "num_channels": 3,
63
+ "num_hidden_layers": 2,
64
+ "patch_size": [
65
+ 4,
66
+ 4
67
+ ],
68
+ "projection_dropout": 0.0,
69
+ "use_absolute_position_embeddings": true,
70
+ "use_mask_token": false,
71
+ "use_mean_pooling": true,
72
+ "use_qk_norm": false
73
+ },
74
+ "vision_feature_layer": -1,
75
+ "vision_feature_select_strategy": "default"
76
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5719424494ff4b3a5fffa28a49a557e99b9488bc61b936b03ac0045bdef98c60
3
+ size 78450664
preprocessor_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": [
4
+ 64,
5
+ 64
6
+ ],
7
+ "width": [
8
+ 64,
9
+ 64
10
+ ]
11
+ },
12
+ "crop_to_patches": false,
13
+ "do_convert_rgb": true,
14
+ "do_normalize": true,
15
+ "do_rescale": true,
16
+ "do_resize": true,
17
+ "image_mean": [
18
+ 0.48145466,
19
+ 0.4578275,
20
+ 0.40821073
21
+ ],
22
+ "image_processor_type": "GotOcr2ImageProcessor",
23
+ "image_std": [
24
+ 0.26862954,
25
+ 0.26130258,
26
+ 0.27577711
27
+ ],
28
+ "max_patches": 12,
29
+ "min_patches": 1,
30
+ "resample": 3,
31
+ "rescale_factor": 0.00392156862745098,
32
+ "size": {
33
+ "height": [
34
+ 64,
35
+ 64
36
+ ],
37
+ "width": [
38
+ 64,
39
+ 64
40
+ ]
41
+ }
42
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd0c8be238c81a5f0450067d9565e16794aef2699df631fcf3dd0c2ac4842b06
3
+ size 11423728
tokenizer_config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "context_image_token": "<IMG_CONTEXT>",
7
+ "end_image_token": "</img>",
8
+ "eos_token": "<|im_end|>",
9
+ "errors": "replace",
10
+ "is_local": true,
11
+ "local_files_only": false,
12
+ "model_max_length": 8192,
13
+ "model_specific_special_tokens": {
14
+ "context_image_token": "<IMG_CONTEXT>",
15
+ "end_image_token": "</img>",
16
+ "start_image_token": "<img>",
17
+ "video_token": "<video>"
18
+ },
19
+ "pad_token": "<|endoftext|>",
20
+ "return_token_type_ids": false,
21
+ "split_special_tokens": false,
22
+ "start_image_token": "<img>",
23
+ "tokenizer_class": "Qwen2Tokenizer",
24
+ "unk_token": null,
25
+ "video_token": "<video>"
26
+ }
video_preprocessor_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": [
4
+ 64,
5
+ 64
6
+ ],
7
+ "width": [
8
+ 64,
9
+ 64
10
+ ]
11
+ },
12
+ "do_convert_rgb": true,
13
+ "do_normalize": true,
14
+ "do_rescale": true,
15
+ "do_resize": true,
16
+ "do_sample_frames": false,
17
+ "image_mean": [
18
+ 0.48145466,
19
+ 0.4578275,
20
+ 0.40821073
21
+ ],
22
+ "image_std": [
23
+ 0.26862954,
24
+ 0.26130258,
25
+ 0.27577711
26
+ ],
27
+ "initial_shift": true,
28
+ "resample": 3,
29
+ "rescale_factor": 0.00392156862745098,
30
+ "return_metadata": false,
31
+ "size": {
32
+ "height": [
33
+ 64,
34
+ 64
35
+ ],
36
+ "width": [
37
+ 64,
38
+ 64
39
+ ]
40
+ },
41
+ "video_processor_type": "InternVLVideoProcessor"
42
+ }