hf-transformers-bot commited on
Commit
e39b46a
·
verified ·
1 Parent(s): fbed666

Update tiny models for Granite4VisionForConditionalGeneration

Browse files
chat_template.jinja ADDED
@@ -0,0 +1 @@
 
 
1
+ {{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token}}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}
config.json ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Granite4VisionForConditionalGeneration"
4
+ ],
5
+ "deepstack_layer_map": [
6
+ [
7
+ 1,
8
+ 0
9
+ ]
10
+ ],
11
+ "downsample_rate": "1/2",
12
+ "dtype": "float32",
13
+ "image_grid_pinpoints": [
14
+ [
15
+ 8,
16
+ 8
17
+ ]
18
+ ],
19
+ "image_seq_length": 576,
20
+ "image_token_index": 3,
21
+ "model_type": "granite4_vision",
22
+ "pad_token_id": 32001,
23
+ "projector_dropout": 0.0,
24
+ "qformer_config": {
25
+ "attention_probs_dropout_prob": 0.1,
26
+ "cross_attention_frequency": 1,
27
+ "encoder_hidden_size": 64,
28
+ "hidden_act": "gelu",
29
+ "hidden_dropout_prob": 0.1,
30
+ "hidden_size": 64,
31
+ "initializer_range": 0.02,
32
+ "intermediate_size": 64,
33
+ "layer_norm_eps": 1e-12,
34
+ "max_position_embeddings": 2048,
35
+ "model_type": "blip_2_qformer",
36
+ "num_attention_heads": 1,
37
+ "num_hidden_layers": 1,
38
+ "pad_token_id": 0,
39
+ "use_qformer_text_input": false,
40
+ "vocab_size": 30522
41
+ },
42
+ "spatial_target_layers": [
43
+ 12,
44
+ 15,
45
+ 18,
46
+ 21
47
+ ],
48
+ "spatial_vision_layer": -1,
49
+ "text_config": {
50
+ "attention_bias": false,
51
+ "attention_dropout": 0.0,
52
+ "attention_multiplier": 1.0,
53
+ "bos_token_id": 1,
54
+ "embedding_multiplier": 1.0,
55
+ "eos_token_id": 2,
56
+ "hidden_act": "gelu",
57
+ "hidden_size": 64,
58
+ "initializer_range": 0.02,
59
+ "intermediate_size": 64,
60
+ "logits_scaling": 1.0,
61
+ "max_position_embeddings": 512,
62
+ "mlp_bias": false,
63
+ "model_type": "granite",
64
+ "num_attention_heads": 2,
65
+ "num_hidden_layers": 2,
66
+ "num_key_value_heads": 2,
67
+ "pad_token_id": 32001,
68
+ "residual_multiplier": 1.0,
69
+ "rms_norm_eps": 1e-06,
70
+ "rope_parameters": {
71
+ "rope_theta": 10000.0,
72
+ "rope_type": "default"
73
+ },
74
+ "tie_word_embeddings": false,
75
+ "use_cache": true,
76
+ "vocab_size": 32002
77
+ },
78
+ "tie_word_embeddings": false,
79
+ "transformers_version": "5.16.0.dev0",
80
+ "vision_config": {
81
+ "attention_dropout": 0.0,
82
+ "hidden_act": "gelu",
83
+ "hidden_size": 64,
84
+ "image_size": 8,
85
+ "initializer_factor": 1.0,
86
+ "initializer_range": 0.02,
87
+ "intermediate_size": 64,
88
+ "layer_norm_eps": 1e-05,
89
+ "model_type": "clip_vision_model",
90
+ "num_attention_heads": 2,
91
+ "num_channels": 3,
92
+ "num_hidden_layers": 2,
93
+ "patch_size": 2,
94
+ "projection_dim": 64
95
+ },
96
+ "vision_feature_layer": -1,
97
+ "vision_feature_select_strategy": "default"
98
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "pad_token_id": 32001,
8
+ "transformers_version": "5.16.0.dev0",
9
+ "use_cache": true
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73cedf6b9fa1a5da106b4b8a7a7b1a1ce677315bf333c846dc750f2f8570d2ac
3
+ size 17792144
preprocessor_config.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "longest_edge": 8,
4
+ "shortest_edge": 8
5
+ },
6
+ "do_center_crop": true,
7
+ "do_convert_rgb": true,
8
+ "do_normalize": true,
9
+ "do_pad": true,
10
+ "do_rescale": true,
11
+ "do_resize": true,
12
+ "image_grid_pinpoints": [
13
+ [
14
+ 336,
15
+ 672
16
+ ],
17
+ [
18
+ 672,
19
+ 336
20
+ ],
21
+ [
22
+ 672,
23
+ 672
24
+ ],
25
+ [
26
+ 1008,
27
+ 336
28
+ ],
29
+ [
30
+ 336,
31
+ 1008
32
+ ]
33
+ ],
34
+ "image_mean": [
35
+ 0.48145466,
36
+ 0.4578275,
37
+ 0.40821073
38
+ ],
39
+ "image_processor_type": "LlavaNextImageProcessor",
40
+ "image_std": [
41
+ 0.26862954,
42
+ 0.26130258,
43
+ 0.27577711
44
+ ],
45
+ "resample": 3,
46
+ "rescale_factor": 0.00392156862745098,
47
+ "size": {
48
+ "longest_edge": 8,
49
+ "shortest_edge": 8
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": null,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<s>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "</s>",
7
+ "image_token": "<image>",
8
+ "is_local": true,
9
+ "legacy": true,
10
+ "local_files_only": false,
11
+ "max_length": null,
12
+ "model_max_length": 1000000000000000019884624838656,
13
+ "model_specific_special_tokens": {
14
+ "image_token": "<image>"
15
+ },
16
+ "pad_to_multiple_of": null,
17
+ "pad_token": "<pad>",
18
+ "pad_token_type_id": 0,
19
+ "padding_side": "left",
20
+ "processor_class": "LlavaNextProcessor",
21
+ "sp_model_kwargs": {},
22
+ "spaces_between_special_tokens": false,
23
+ "tokenizer_class": "TokenizersBackend",
24
+ "unk_token": "<unk>",
25
+ "use_default_system_prompt": false
26
+ }