hf-transformers-bot commited on
Commit
c1d29da
·
verified ·
1 Parent(s): e8bad5f

Update tiny models for DeepseekVLHybridForConditionalGeneration

Browse files
chat_template.jinja ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {% set seps = ['
2
+
3
+ ', '<|end▁of▁sentence|>'] %}{% set i = 0 %}You are a helpful language and vision assistant. You are able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language.
4
+
5
+ {% for message in messages %}{% if message['role']|lower == 'user' %}User: {% elif message['role']|lower == 'assistant' %}Assistant:{% if not (loop.last and not add_generation_prompt and message['content'][0]['type']=='text' and message['content'][0]['text']=='') %} {% endif %}{% else %}{{ message['role'].capitalize() }}: {% endif %}{% for content in message['content'] %}{% if content['type'] == 'image' %}<image_placeholder>{% elif content['type'] == 'text' %}{% set text = content['text'] %}{% if loop.first %}{% set text = text.lstrip() %}{% endif %}{% if loop.last %}{% set text = text.rstrip() %}{% endif %}{% if not loop.first and message['content'][loop.index0-1]['type'] == 'text' %}{{ ' ' + text }}{% else %}{{ text }}{% endif %}{% endif %}{% endfor %}{% if not loop.last or add_generation_prompt %}{% if message['role']|lower == 'user' %}{{ seps[0] }}{% else %}{{ seps[1] }}{% endif %}{% endif %}{% endfor %}{% if add_generation_prompt %}Assistant:{% endif %}
config.json ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DeepseekVLHybridForConditionalGeneration"
4
+ ],
5
+ "dtype": "float32",
6
+ "high_res_vision_config": {
7
+ "attention_dropout": 0.0,
8
+ "global_attn_indexes": [
9
+ 0
10
+ ],
11
+ "hidden_act": "gelu",
12
+ "hidden_size": 16,
13
+ "image_size": 128,
14
+ "initializer_range": 1e-10,
15
+ "intermediate_size": 37,
16
+ "layer_norm_eps": 1e-06,
17
+ "mlp_dim": 24,
18
+ "mlp_ratio": 4.0,
19
+ "model_type": "sam_vision_model",
20
+ "num_attention_heads": 4,
21
+ "num_channels": 3,
22
+ "num_hidden_layers": 2,
23
+ "num_pos_feats": 128,
24
+ "output_channels": 4,
25
+ "patch_size": 32,
26
+ "qkv_bias": true,
27
+ "scale": 8,
28
+ "use_abs_pos": true,
29
+ "use_rel_pos": true,
30
+ "window_size": 14
31
+ },
32
+ "image_token_id": 98,
33
+ "model_type": "deepseek_vl_hybrid",
34
+ "text_config": {
35
+ "attention_bias": false,
36
+ "attention_dropout": 0.0,
37
+ "bos_token_id": 100000,
38
+ "eos_token_id": 100001,
39
+ "head_dim": 4,
40
+ "hidden_act": "silu",
41
+ "hidden_size": 16,
42
+ "initializer_range": 0.02,
43
+ "intermediate_size": 37,
44
+ "max_position_embeddings": 512,
45
+ "mlp_bias": false,
46
+ "model_type": "llama",
47
+ "num_attention_heads": 4,
48
+ "num_hidden_layers": 2,
49
+ "num_key_value_heads": 4,
50
+ "pad_token_id": 100001,
51
+ "pretraining_tp": 1,
52
+ "rms_norm_eps": 1e-06,
53
+ "rope_parameters": {
54
+ "rope_theta": 10000.0,
55
+ "rope_type": "default"
56
+ },
57
+ "tie_word_embeddings": false,
58
+ "use_cache": true,
59
+ "vocab_size": 100016
60
+ },
61
+ "tie_word_embeddings": true,
62
+ "transformers_version": "5.16.0.dev0",
63
+ "vision_config": {
64
+ "attention_dropout": 0.0,
65
+ "hidden_act": "gelu",
66
+ "hidden_size": 16,
67
+ "image_size": 32,
68
+ "intermediate_size": 37,
69
+ "layer_norm_eps": 1e-06,
70
+ "model_type": "siglip_vision_model",
71
+ "num_attention_heads": 4,
72
+ "num_channels": 3,
73
+ "num_hidden_layers": 1,
74
+ "patch_size": 8,
75
+ "vision_use_head": false
76
+ }
77
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 100000,
4
+ "eos_token_id": 100001,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "pad_token_id": 100001,
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:80ff5313ab21dc4da411adc33053ac23e962745dc235a686f42607049c49b092
3
+ size 6682120
preprocessor_config.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "background_color": [
3
+ 127,
4
+ 127,
5
+ 127
6
+ ],
7
+ "crop_size": {
8
+ "height": 32,
9
+ "width": 32
10
+ },
11
+ "do_normalize": true,
12
+ "do_pad": true,
13
+ "do_rescale": true,
14
+ "do_resize": true,
15
+ "high_res_background_color": [
16
+ 127,
17
+ 127,
18
+ 127
19
+ ],
20
+ "high_res_image_mean": [
21
+ 0.48145466,
22
+ 0.4578275,
23
+ 0.40821073
24
+ ],
25
+ "high_res_image_std": [
26
+ 0.26862954,
27
+ 0.26130258,
28
+ 0.27577711
29
+ ],
30
+ "high_res_resample": 3,
31
+ "high_res_size": {
32
+ "height": 1024,
33
+ "width": 1024
34
+ },
35
+ "image_mean": [
36
+ 0.48145466,
37
+ 0.4578275,
38
+ 0.40821073
39
+ ],
40
+ "image_processor_type": "DeepseekVLHybridImageProcessor",
41
+ "image_std": [
42
+ 0.26862954,
43
+ 0.26130258,
44
+ 0.27577711
45
+ ],
46
+ "min_size": 14,
47
+ "resample": 3,
48
+ "rescale_factor": 0.00392156862745098,
49
+ "size": {
50
+ "height": 32,
51
+ "width": 32
52
+ }
53
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": null,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|begin▁of▁sentence|>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|end▁of▁sentence|>",
7
+ "image_token": "<image_placeholder>",
8
+ "is_local": true,
9
+ "legacy": true,
10
+ "local_files_only": false,
11
+ "model_max_length": 16384,
12
+ "model_specific_special_tokens": {
13
+ "image_token": "<image_placeholder>"
14
+ },
15
+ "pad_token": "<|end▁of▁sentence|>",
16
+ "processor_class": "DeepseekVLHybridProcessor",
17
+ "tokenizer_class": "TokenizersBackend",
18
+ "unk_token": null,
19
+ "use_default_system_prompt": false
20
+ }