joerunde commited on
Commit
991a619
·
verified ·
1 Parent(s): 4530b39

initial snapshot

Browse files
README.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - test
5
+ - fixture
6
+ ---
7
+
8
+ # nano-gv
9
+
10
+ Random-init ~16 MB CI fixture for the [sendnn-inference](https://github.com/torch-spyre/sendnn-inference)
11
+ plugin's async multimodal-encoder tests. Generated by `tools/build_nano_gv.py`
12
+ from [`ibm-granite/granite-vision-3.2-2b`](https://huggingface.co/ibm-granite/granite-vision-3.2-2b)'s config.
13
+
14
+ **Not a functional model — outputs are meaningless.** Do not use for
15
+ inference. The architecture identifiers (`LlavaNextForConditionalGeneration`
16
+ + granite text + siglip vision) match the source, but every dim is
17
+ shrunk to the minimum that still exercises the plugin's MM code paths:
18
+
19
+ | component | source | nano |
20
+ |-----------|------------------|---------------------|
21
+ | text hidden | 2048 | 128 |
22
+ | text layers | 40 | 2 |
23
+ | text heads | 32 | 2 |
24
+ | text head_dim | 64 | 128 (plugin req) |
25
+ | vision hidden | 1152 | 64 |
26
+ | vision layers | 27 | 4 |
27
+ | image size | 384 | 112 |
28
+
29
+ The tokenizer + processor are copied from the source verbatim (with
30
+ image-size fields rescaled to 112) so `image_token_index` and the chat
31
+ template stay valid.
chat_template.jinja ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|start_of_role|>available_tools<|end_of_role|>
3
+ ' }}
4
+ {%- for tool in tools %}
5
+ {{- tool | tojson(indent=4) }}
6
+ {%- if not loop.last %}
7
+ {{- '
8
+
9
+ ' }}
10
+ {%- endif %}
11
+ {%- endfor %}
12
+ {{- '<|end_of_text|>
13
+ ' }}
14
+ {%- endif %}
15
+ {%- for message in messages if message['role'] == 'system'%}{% else %}<|system|>
16
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
17
+ {% endfor %}{%- for message in messages %}
18
+ {%- if message['role'] == 'system' %}
19
+ {{- '<|system|>
20
+ ' + message['content'][0]['text'] + '
21
+ ' }}
22
+ {%- elif message['role'] == 'user' %}<|user|>
23
+ {# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>
24
+ ' }}{% endfor %}{# Render all text next #}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ content['text'] + '
25
+ ' }}{% endfor %}
26
+ {%- elif message['role'] == 'assistant' %}
27
+ {{- '<|assistant|>
28
+ ' + message['content'][0]['text'] + '<|end_of_text|>' }}
29
+ {%- elif message['role'] == 'assistant_tool_call' %}
30
+ {{- '<|start_of_role|>assistant<|end_of_role|><|tool_call|>' + message['content'][0]['text'] + '<|end_of_text|>
31
+ ' }}
32
+ {%- elif message['role'] == 'tool_response' %}
33
+ {{- '<|start_of_role|>tool_response<|end_of_role|>' + message['content'][0]['text'] + '<|end_of_text|>
34
+ ' }}
35
+ {%- endif %}
36
+ {%- if loop.last and add_generation_prompt %}
37
+ {{- '<|assistant|>
38
+ ' }}
39
+ {%- endif %}
40
+ {%- endfor %}
config.json ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlavaNextForConditionalGeneration"
4
+ ],
5
+ "dtype": "bfloat16",
6
+ "image_grid_pinpoints": [
7
+ [
8
+ 112,
9
+ 112
10
+ ],
11
+ [
12
+ 112,
13
+ 224
14
+ ],
15
+ [
16
+ 224,
17
+ 112
18
+ ]
19
+ ],
20
+ "image_seq_length": 576,
21
+ "image_token_index": 49155,
22
+ "model_type": "llava_next",
23
+ "multimodal_projector_bias": true,
24
+ "projector_hidden_act": "gelu",
25
+ "text_config": {
26
+ "architectures": [
27
+ "GraniteForCausalLM"
28
+ ],
29
+ "attention_bias": false,
30
+ "attention_dropout": 0.1,
31
+ "attention_multiplier": 0.015625,
32
+ "bos_token_id": 0,
33
+ "dtype": "bfloat16",
34
+ "embedding_multiplier": 12.0,
35
+ "eos_token_id": 0,
36
+ "head_dim": 128,
37
+ "hidden_act": "silu",
38
+ "hidden_size": 128,
39
+ "initializer_range": 0.02,
40
+ "intermediate_size": 128,
41
+ "logits_scaling": 8.0,
42
+ "max_position_embeddings": 131072,
43
+ "mlp_bias": false,
44
+ "model_type": "granite",
45
+ "num_attention_heads": 2,
46
+ "num_hidden_layers": 2,
47
+ "num_key_value_heads": 2,
48
+ "pad_token_id": 0,
49
+ "residual_multiplier": 0.22,
50
+ "rms_norm_eps": 1e-05,
51
+ "rope_parameters": {
52
+ "rope_theta": 300000,
53
+ "rope_type": "default"
54
+ },
55
+ "tie_word_embeddings": true,
56
+ "use_cache": true,
57
+ "vocab_size": 49156
58
+ },
59
+ "tie_word_embeddings": true,
60
+ "transformers_version": "5.8.1",
61
+ "use_image_newline_parameter": true,
62
+ "vision_config": {
63
+ "attention_dropout": 0.0,
64
+ "hidden_act": "gelu_pytorch_tanh",
65
+ "hidden_size": 64,
66
+ "image_size": 112,
67
+ "intermediate_size": 128,
68
+ "layer_norm_eps": 1e-06,
69
+ "model_type": "siglip_vision_model",
70
+ "num_attention_heads": 4,
71
+ "num_channels": 3,
72
+ "num_hidden_layers": 4,
73
+ "patch_size": 14
74
+ },
75
+ "vision_feature_layer": [
76
+ -4,
77
+ -3,
78
+ -2,
79
+ -1
80
+ ],
81
+ "vision_feature_select_strategy": "full"
82
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 0,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "pad_token_id": 0,
8
+ "transformers_version": "5.8.1",
9
+ "use_cache": true
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:736d1d4ff4f960d1c876502fce575b1d950ec1bc6e28dd36fc9ae6eecfbedd80
3
+ size 13835872
processor_config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "crop_size": {
4
+ "height": 112,
5
+ "width": 112
6
+ },
7
+ "do_center_crop": true,
8
+ "do_convert_rgb": null,
9
+ "do_normalize": true,
10
+ "do_pad": true,
11
+ "do_rescale": true,
12
+ "do_resize": true,
13
+ "image_grid_pinpoints": [
14
+ [
15
+ 112,
16
+ 112
17
+ ],
18
+ [
19
+ 112,
20
+ 224
21
+ ],
22
+ [
23
+ 224,
24
+ 112
25
+ ]
26
+ ],
27
+ "image_mean": [
28
+ 0.5,
29
+ 0.5,
30
+ 0.5
31
+ ],
32
+ "image_processor_type": "LlavaNextImageProcessor",
33
+ "image_std": [
34
+ 0.5,
35
+ 0.5,
36
+ 0.5
37
+ ],
38
+ "resample": 3,
39
+ "rescale_factor": 0.00392156862745098,
40
+ "size": {
41
+ "height": 112,
42
+ "width": 112
43
+ }
44
+ },
45
+ "image_token": "<image>",
46
+ "num_additional_image_tokens": 0,
47
+ "patch_size": 14,
48
+ "processor_class": "LlavaNextProcessor",
49
+ "vision_feature_select_strategy": "full"
50
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|end_of_text|>",
5
+ "clean_up_tokenization_spaces": true,
6
+ "eos_token": "<|end_of_text|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|start_of_role|>",
10
+ "<|end_of_role|>",
11
+ "<|tool_call|>"
12
+ ],
13
+ "is_local": false,
14
+ "local_files_only": false,
15
+ "model_max_length": 131072,
16
+ "pad_token": "<|end_of_text|>",
17
+ "padding_side": "right",
18
+ "processor_class": "LlavaNextProcessor",
19
+ "tokenizer_class": "TokenizersBackend",
20
+ "unk_token": "<|end_of_text|>",
21
+ "vocab_size": 49152
22
+ }