Update tiny models for DeepseekVLForConditionalGeneration
Browse files- chat_template.jinja +5 -0
- config.json +52 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
- preprocessor_config.json +33 -0
- tokenizer.json +0 -0
- tokenizer_config.json +20 -0
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,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DeepseekVLForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"dtype": "float32",
|
| 6 |
+
"image_token_id": 3,
|
| 7 |
+
"model_type": "deepseek_vl",
|
| 8 |
+
"pad_token_id": 100001,
|
| 9 |
+
"text_config": {
|
| 10 |
+
"attention_bias": false,
|
| 11 |
+
"attention_dropout": 0.0,
|
| 12 |
+
"bos_token_id": 100000,
|
| 13 |
+
"eos_token_id": 100001,
|
| 14 |
+
"head_dim": 16,
|
| 15 |
+
"hidden_act": "gelu",
|
| 16 |
+
"hidden_size": 32,
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
+
"intermediate_size": 32,
|
| 19 |
+
"max_position_embeddings": 512,
|
| 20 |
+
"mlp_bias": false,
|
| 21 |
+
"model_type": "llama",
|
| 22 |
+
"num_attention_heads": 2,
|
| 23 |
+
"num_hidden_layers": 2,
|
| 24 |
+
"num_key_value_heads": 2,
|
| 25 |
+
"pad_token_id": 100001,
|
| 26 |
+
"pretraining_tp": 1,
|
| 27 |
+
"rms_norm_eps": 1e-06,
|
| 28 |
+
"rope_parameters": {
|
| 29 |
+
"rope_theta": 10000.0,
|
| 30 |
+
"rope_type": "default"
|
| 31 |
+
},
|
| 32 |
+
"tie_word_embeddings": false,
|
| 33 |
+
"use_cache": true,
|
| 34 |
+
"vocab_size": 100016
|
| 35 |
+
},
|
| 36 |
+
"tie_word_embeddings": false,
|
| 37 |
+
"transformers_version": "5.16.0.dev0",
|
| 38 |
+
"vision_config": {
|
| 39 |
+
"attention_dropout": 0.0,
|
| 40 |
+
"hidden_act": "gelu",
|
| 41 |
+
"hidden_size": 32,
|
| 42 |
+
"image_size": 8,
|
| 43 |
+
"intermediate_size": 32,
|
| 44 |
+
"layer_norm_eps": 1e-06,
|
| 45 |
+
"model_type": "siglip_vision_model",
|
| 46 |
+
"num_attention_heads": 2,
|
| 47 |
+
"num_channels": 3,
|
| 48 |
+
"num_hidden_layers": 2,
|
| 49 |
+
"patch_size": 4,
|
| 50 |
+
"vision_use_head": false
|
| 51 |
+
}
|
| 52 |
+
}
|
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:20417a0c11014e4c9ef382ceb96cf62137fd30fde00a8ad531da5f1acac1a983
|
| 3 |
+
size 25736704
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"background_color": [
|
| 3 |
+
127,
|
| 4 |
+
127,
|
| 5 |
+
127
|
| 6 |
+
],
|
| 7 |
+
"crop_size": {
|
| 8 |
+
"height": 8,
|
| 9 |
+
"width": 8
|
| 10 |
+
},
|
| 11 |
+
"do_normalize": true,
|
| 12 |
+
"do_pad": true,
|
| 13 |
+
"do_rescale": true,
|
| 14 |
+
"do_resize": true,
|
| 15 |
+
"image_mean": [
|
| 16 |
+
0.48145466,
|
| 17 |
+
0.4578275,
|
| 18 |
+
0.40821073
|
| 19 |
+
],
|
| 20 |
+
"image_processor_type": "DeepseekVLImageProcessor",
|
| 21 |
+
"image_std": [
|
| 22 |
+
0.26862954,
|
| 23 |
+
0.26130258,
|
| 24 |
+
0.27577711
|
| 25 |
+
],
|
| 26 |
+
"min_size": 14,
|
| 27 |
+
"resample": 3,
|
| 28 |
+
"rescale_factor": 0.00392156862745098,
|
| 29 |
+
"size": {
|
| 30 |
+
"height": 8,
|
| 31 |
+
"width": 8
|
| 32 |
+
}
|
| 33 |
+
}
|
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": "DeepseekVLProcessor",
|
| 17 |
+
"tokenizer_class": "TokenizersBackend",
|
| 18 |
+
"unk_token": null,
|
| 19 |
+
"use_default_system_prompt": false
|
| 20 |
+
}
|