hf-transformers-bot commited on
Commit
6c6905b
·
verified ·
1 Parent(s): 4b7a0ed

Update tiny models for ColQwen2ForRetrieval

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{% for message in messages %}{% if loop.first and message['role'] != 'system' %}<|im_start|>system
2
+ You are a helpful assistant.<|im_end|>
3
+ {% endif %}<|im_start|>{{ message['role'] }}
4
+ {% if message['content'] is string %}{{ message['content'] }}<|im_end|>
5
+ {% else %}{% for content in message['content'] %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|vision_start|><|image_pad|><|vision_end|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|vision_start|><|video_pad|><|vision_end|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}<|im_end|>
6
+ {% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant
7
+ {% endif %}
config.json ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ColQwen2ForRetrieval"
4
+ ],
5
+ "dtype": "float32",
6
+ "embedding_dim": 32,
7
+ "initializer_range": 0.02,
8
+ "model_type": "colqwen2",
9
+ "transformers_version": "5.16.0.dev0",
10
+ "vlm_config": {
11
+ "_name_or_path": "Qwen/Qwen2-VL-2B-Instruct",
12
+ "image_token_id": 4,
13
+ "model_type": "qwen2_vl",
14
+ "text_config": {
15
+ "_name_or_path": "",
16
+ "architectures": null,
17
+ "attention_dropout": 0.0,
18
+ "bos_token_id": 0,
19
+ "chunk_size_feed_forward": 0,
20
+ "dtype": null,
21
+ "eos_token_id": 1,
22
+ "hidden_act": "silu",
23
+ "hidden_size": 64,
24
+ "id2label": {
25
+ "0": "LABEL_0",
26
+ "1": "LABEL_1"
27
+ },
28
+ "initializer_range": 0.02,
29
+ "intermediate_size": 2,
30
+ "is_encoder_decoder": false,
31
+ "label2id": {
32
+ "LABEL_0": 0,
33
+ "LABEL_1": 1
34
+ },
35
+ "layer_types": [
36
+ "full_attention",
37
+ "full_attention"
38
+ ],
39
+ "max_position_embeddings": 32768,
40
+ "max_window_layers": 2,
41
+ "model_type": "qwen2_vl_text",
42
+ "num_attention_heads": 2,
43
+ "num_hidden_layers": 2,
44
+ "num_key_value_heads": 2,
45
+ "output_attentions": false,
46
+ "output_hidden_states": false,
47
+ "pad_token_id": null,
48
+ "problem_type": null,
49
+ "return_dict": true,
50
+ "rms_norm_eps": 1e-06,
51
+ "rope_parameters": {
52
+ "mrope_section": [
53
+ 4,
54
+ 6,
55
+ 6
56
+ ],
57
+ "rope_theta": 1000000.0,
58
+ "rope_type": "default",
59
+ "type": "default"
60
+ },
61
+ "sliding_window": null,
62
+ "use_cache": true,
63
+ "use_sliding_window": false,
64
+ "vocab_size": 99
65
+ },
66
+ "tie_word_embeddings": true,
67
+ "video_token_id": 5,
68
+ "vision_config": {
69
+ "_name_or_path": "",
70
+ "architectures": null,
71
+ "chunk_size_feed_forward": 0,
72
+ "depth": 2,
73
+ "dtype": null,
74
+ "embed_dim": 32,
75
+ "hidden_act": "quick_gelu",
76
+ "hidden_size": 64,
77
+ "id2label": {
78
+ "0": "LABEL_0",
79
+ "1": "LABEL_1"
80
+ },
81
+ "in_channels": 3,
82
+ "in_chans": 3,
83
+ "initializer_range": 0.02,
84
+ "is_encoder_decoder": false,
85
+ "label2id": {
86
+ "LABEL_0": 0,
87
+ "LABEL_1": 1
88
+ },
89
+ "mlp_ratio": 4,
90
+ "model_type": "qwen2_vl_vision",
91
+ "num_heads": 4,
92
+ "output_attentions": false,
93
+ "output_hidden_states": false,
94
+ "patch_size": 14,
95
+ "problem_type": null,
96
+ "return_dict": true,
97
+ "spatial_merge_size": 1,
98
+ "temporal_patch_size": 2
99
+ },
100
+ "vision_end_token_id": 151653,
101
+ "vision_start_token_id": 3,
102
+ "vision_token_id": 151654,
103
+ "vocab_size": 99
104
+ }
105
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f2e77eea8db13211164e172738610f5031ee7419d1f49126485cc0219888d7a
3
+ size 441840
preprocessor_config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": true,
3
+ "do_normalize": true,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "image_mean": [
7
+ 0.48145466,
8
+ 0.4578275,
9
+ 0.40821073
10
+ ],
11
+ "image_processor_type": "Qwen2VLImageProcessor",
12
+ "image_std": [
13
+ 0.26862954,
14
+ 0.26130258,
15
+ 0.27577711
16
+ ],
17
+ "merge_size": 2,
18
+ "patch_size": 14,
19
+ "resample": 3,
20
+ "rescale_factor": 0.00392156862745098,
21
+ "size": {
22
+ "longest_edge": 602112,
23
+ "shortest_edge": 3136
24
+ },
25
+ "temporal_patch_size": 2
26
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff8cce547abc110590d19c6b5b6e0c6a7b4c8d1012d78b9c42131bae7f494a02
3
+ size 11420367
tokenizer_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>"
22
+ ],
23
+ "is_local": true,
24
+ "local_files_only": false,
25
+ "model_max_length": 32768,
26
+ "pad_token": "<|endoftext|>",
27
+ "padding_side": "left",
28
+ "processor_class": "ColQwen2Processor",
29
+ "split_special_tokens": false,
30
+ "tokenizer_class": "Qwen2Tokenizer",
31
+ "unk_token": null
32
+ }
video_preprocessor_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": true,
3
+ "do_normalize": true,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "do_sample_frames": false,
7
+ "image_mean": [
8
+ 0.48145466,
9
+ 0.4578275,
10
+ 0.40821073
11
+ ],
12
+ "image_std": [
13
+ 0.26862954,
14
+ 0.26130258,
15
+ 0.27577711
16
+ ],
17
+ "max_frames": 768,
18
+ "merge_size": 2,
19
+ "min_frames": 4,
20
+ "patch_size": 14,
21
+ "resample": 3,
22
+ "rescale_factor": 0.00392156862745098,
23
+ "return_metadata": false,
24
+ "size": {
25
+ "longest_edge": 602112,
26
+ "shortest_edge": 3136
27
+ },
28
+ "temporal_patch_size": 2,
29
+ "video_processor_type": "Qwen2VLVideoProcessor"
30
+ }