hf-transformers-bot commited on
Commit
bce4f4a
·
verified ·
1 Parent(s): f293844

Update tiny models for PerceptionLMForConditionalGeneration

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,3 @@
 
 
 
 
1
+ {{- bos_token }}{%- if messages[0]['role'] == 'system' -%} {%- set system_message = messages[0]['content']|trim %}
2
+ {%- set messages = messages[1:] %}
3
+ {%- else %} {%- set system_message = '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.' %}{%- endif %}{{- '<|start_header_id|>system<|end_header_id|>\n\n' }}{{- system_message }}{{- '<|eot_id|>' }}{%- for message in messages %}{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n' }}{%- for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<|image|>' }}{%- endfor %}{%- for content in message['content'] | selectattr('type', 'equalto', 'video') %}{{ '<|video|>' }}{%- endfor %}{%- for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{- content['text'] | trim }}{%- endfor %}{{'<|eot_id|>' }}{%- endfor %}{%- if add_generation_prompt %}{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}{%- endif %}
config.json ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "PerceptionLMForConditionalGeneration"
4
+ ],
5
+ "dtype": "float32",
6
+ "image_token_id": 0,
7
+ "model_type": "perception_lm",
8
+ "projector_pooling_ratio": 1,
9
+ "text_config": {
10
+ "attention_bias": false,
11
+ "attention_dropout": 0.0,
12
+ "attention_probs_dropout_prob": 0.1,
13
+ "bos_token_id": 128000,
14
+ "eos_token_id": 128009,
15
+ "head_dim": 8,
16
+ "hidden_act": "gelu",
17
+ "hidden_dropout_prob": 0.1,
18
+ "hidden_size": 32,
19
+ "id2label": {
20
+ "0": "LABEL_0",
21
+ "1": "LABEL_1",
22
+ "2": "LABEL_2"
23
+ },
24
+ "initializer_range": 0.02,
25
+ "intermediate_size": 37,
26
+ "is_training": true,
27
+ "label2id": {
28
+ "LABEL_0": 0,
29
+ "LABEL_1": 1,
30
+ "LABEL_2": 2
31
+ },
32
+ "max_position_embeddings": 512,
33
+ "mlp_bias": false,
34
+ "model_type": "llama",
35
+ "num_attention_heads": 4,
36
+ "num_choices": 4,
37
+ "num_hidden_layers": 2,
38
+ "num_key_value_heads": 4,
39
+ "pad_token_id": 128001,
40
+ "pretraining_tp": 1,
41
+ "rms_norm_eps": 1e-06,
42
+ "rope_parameters": {
43
+ "rope_theta": 10000.0,
44
+ "rope_type": "default"
45
+ },
46
+ "seq_length": 7,
47
+ "tie_word_embeddings": false,
48
+ "type_sequence_label_size": 2,
49
+ "type_vocab_size": 16,
50
+ "use_cache": true,
51
+ "use_input_mask": true,
52
+ "use_labels": true,
53
+ "use_token_type_ids": false,
54
+ "vocab_size": 128256
55
+ },
56
+ "tie_word_embeddings": true,
57
+ "transformers_version": "5.16.0.dev0",
58
+ "video_token_id": 2,
59
+ "vision_config": {
60
+ "architecture": "vit_pe_core_large_patch14_336",
61
+ "do_pooling": true,
62
+ "initializer_range": 0.02,
63
+ "label_names": [
64
+ "LABEL_0",
65
+ "LABEL_1"
66
+ ],
67
+ "model_args": {
68
+ "depth": 2,
69
+ "embed_dim": 64,
70
+ "global_pool": "",
71
+ "img_size": [
72
+ 14,
73
+ 14
74
+ ],
75
+ "init_values": 0.1,
76
+ "ref_feat_shape": [
77
+ 1,
78
+ 1
79
+ ],
80
+ "use_post_transformer_norm": false
81
+ },
82
+ "model_type": "timm_wrapper",
83
+ "num_classes": 2
84
+ },
85
+ "vision_use_cls_token": true
86
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 128000,
4
+ "eos_token_id": 128009,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "pad_token_id": 128001,
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:db332541daf75b31afaa437875ed78f61bb7f5c9d897cf6fc7b5e3625583eb5b
3
+ size 17050632
preprocessor_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "data_format": "channels_first",
3
+ "default_to_square": true,
4
+ "do_center_crop": false,
5
+ "do_convert_rgb": true,
6
+ "do_normalize": true,
7
+ "do_rescale": true,
8
+ "do_resize": true,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_processor_type": "PerceptionLMImageProcessor",
15
+ "image_std": [
16
+ 0.5,
17
+ 0.5,
18
+ 0.5
19
+ ],
20
+ "max_frame_tiles": 1,
21
+ "max_num_tiles": 36,
22
+ "resample": 3,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "size": {
25
+ "height": 448,
26
+ "width": 448
27
+ },
28
+ "tile_size": 448,
29
+ "vision_input_type": "thumb+tile"
30
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab0d969ef8cfbf1d640debe30a97c3fb11caf9b24b75fa89fbd4e9df1d51cac6
3
+ size 17209923
tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|eot_id|>",
6
+ "image_token": "<|image|>",
7
+ "is_local": true,
8
+ "local_files_only": false,
9
+ "model_input_names": [
10
+ "input_ids",
11
+ "attention_mask"
12
+ ],
13
+ "model_max_length": 11520,
14
+ "model_specific_special_tokens": {
15
+ "image_token": "<|image|>",
16
+ "video_token": "<|video|>"
17
+ },
18
+ "pad_token": "<|end_of_text|>",
19
+ "processor_class": "PerceptionLMProcessor",
20
+ "tokenizer_class": "TokenizersBackend",
21
+ "video_token": "<|video|>"
22
+ }
video_preprocessor_config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "data_format": "channels_first",
3
+ "default_to_square": true,
4
+ "do_center_crop": false,
5
+ "do_convert_rgb": true,
6
+ "do_normalize": true,
7
+ "do_rescale": true,
8
+ "do_resize": true,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "resample": 3,
20
+ "rescale_factor": 0.00392156862745098,
21
+ "return_metadata": false,
22
+ "size": {
23
+ "height": 448,
24
+ "width": 448
25
+ },
26
+ "video_processor_type": "PerceptionLMVideoProcessor"
27
+ }