hf-transformers-bot commited on
Commit
ba9c888
·
verified ·
1 Parent(s): f02b119

Update tiny models for SmolVLMForConditionalGeneration

Browse files
chat_template.jinja ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ <|im_start|>{% for message in messages %}{{message['role'] | capitalize}}{% if message['content'][0]['type'] == 'image' %}{{':'}}{% else %}{{': '}}{% endif %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] == 'image' %}{{ '<image>' }}{% endif %}{% endfor %}<end_of_utterance>
2
+ {% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}
config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "SmolVLMForConditionalGeneration"
4
+ ],
5
+ "dtype": "float32",
6
+ "image_token_id": 49190,
7
+ "model_type": "smolvlm",
8
+ "pad_token_id": 2,
9
+ "scale_factor": 2,
10
+ "text_config": {
11
+ "attention_bias": false,
12
+ "attention_dropout": 0.0,
13
+ "bos_token_id": 1,
14
+ "eos_token_id": 49279,
15
+ "head_dim": 32,
16
+ "hidden_act": "silu",
17
+ "hidden_size": 64,
18
+ "image_token_id": 49190,
19
+ "initializer_range": 0.02,
20
+ "intermediate_size": 56,
21
+ "max_position_embeddings": 256,
22
+ "mlp_bias": false,
23
+ "model_type": "llama",
24
+ "num_attention_heads": 2,
25
+ "num_hidden_layers": 2,
26
+ "num_key_value_heads": 2,
27
+ "pad_token_id": 2,
28
+ "pretraining_tp": 1,
29
+ "rms_norm_eps": 1e-06,
30
+ "rope_parameters": {
31
+ "rope_theta": 10000.0,
32
+ "rope_type": "default"
33
+ },
34
+ "sliding_window": 32,
35
+ "tie_word_embeddings": false,
36
+ "use_cache": true,
37
+ "vocab_size": 49280
38
+ },
39
+ "tie_word_embeddings": false,
40
+ "transformers_version": "5.16.0.dev0",
41
+ "use_cache": false,
42
+ "vision_config": {
43
+ "attention_dropout": 0.1,
44
+ "dropout": 0.1,
45
+ "hidden_act": "gelu_pytorch_tanh",
46
+ "hidden_size": 32,
47
+ "image_size": 16,
48
+ "initializer_range": 0.02,
49
+ "intermediate_size": 32,
50
+ "layer_norm_eps": 1e-06,
51
+ "model_type": "smolvlm_vision",
52
+ "num_attention_heads": 4,
53
+ "num_channels": 3,
54
+ "num_hidden_layers": 2,
55
+ "patch_size": 4
56
+ },
57
+ "vocab_size": 49280
58
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 49279,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "pad_token_id": 2,
8
+ "transformers_version": "5.16.0.dev0",
9
+ "use_cache": false
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dacb3d9a73db914b69d681746f7e06fe1a51a9f2dc6e224f34b5b48d71c72683
3
+ size 25549864
preprocessor_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "longest_edge": 16,
4
+ "shortest_edge": 16
5
+ },
6
+ "do_convert_rgb": true,
7
+ "do_image_splitting": true,
8
+ "do_normalize": true,
9
+ "do_pad": true,
10
+ "do_rescale": true,
11
+ "do_resize": true,
12
+ "image_mean": [
13
+ 0.5,
14
+ 0.5,
15
+ 0.5
16
+ ],
17
+ "image_processor_type": "SmolVLMImageProcessor",
18
+ "image_std": [
19
+ 0.5,
20
+ 0.5,
21
+ 0.5
22
+ ],
23
+ "max_image_size": {
24
+ "longest_edge": 364
25
+ },
26
+ "resample": 1,
27
+ "rescale_factor": 0.00392156862745098,
28
+ "size": {
29
+ "longest_edge": 16,
30
+ "shortest_edge": 16
31
+ }
32
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|im_start|>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "end_of_utterance_token": "<end_of_utterance>",
7
+ "eos_token": "<end_of_utterance>",
8
+ "fake_image_token": "<fake_token_around_image>",
9
+ "global_image_token": "<global-img>",
10
+ "image_token": "<image>",
11
+ "is_local": true,
12
+ "legacy": false,
13
+ "local_files_only": false,
14
+ "model_max_length": 16384,
15
+ "model_specific_special_tokens": {
16
+ "end_of_utterance_token": "<end_of_utterance>",
17
+ "fake_image_token": "<fake_token_around_image>",
18
+ "global_image_token": "<global-img>",
19
+ "image_token": "<image>"
20
+ },
21
+ "pad_token": "<|im_end|>",
22
+ "processor_class": "SmolVLMProcessor",
23
+ "tokenizer_class": "TokenizersBackend",
24
+ "truncation_side": "left",
25
+ "unk_token": "<|endoftext|>",
26
+ "vocab_size": 49152
27
+ }
video_preprocessor_config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "longest_edge": 16,
4
+ "shortest_edge": 16
5
+ },
6
+ "do_convert_rgb": true,
7
+ "do_normalize": true,
8
+ "do_pad": true,
9
+ "do_rescale": true,
10
+ "do_resize": true,
11
+ "do_sample_frames": false,
12
+ "image_mean": [
13
+ 0.5,
14
+ 0.5,
15
+ 0.5
16
+ ],
17
+ "image_std": [
18
+ 0.5,
19
+ 0.5,
20
+ 0.5
21
+ ],
22
+ "max_image_size": {
23
+ "longest_edge": 364
24
+ },
25
+ "resample": 1,
26
+ "rescale_factor": 0.00392156862745098,
27
+ "return_metadata": false,
28
+ "size": {
29
+ "longest_edge": 16,
30
+ "shortest_edge": 16
31
+ },
32
+ "video_processor_type": "SmolVLMVideoProcessor"
33
+ }