hf-transformers-bot commited on
Commit
e0e4657
·
verified ·
1 Parent(s): 3112b1f

Update tiny models for JanusForConditionalGeneration

Browse files
chat_template.jinja ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {%set seps=['
2
+
3
+ ','<|end▁of▁sentence|>']%}{%set i=0%}{%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'%}{%if not loop.first%}{{'
4
+ '}}{%endif%}<image_placeholder>{%if not loop.last%}{{'
5
+ '}}{%endif%}{%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,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "JanusForConditionalGeneration"
4
+ ],
5
+ "dtype": "float32",
6
+ "image_token_id": 0,
7
+ "model_type": "janus",
8
+ "text_config": {
9
+ "attention_bias": false,
10
+ "attention_dropout": 0.0,
11
+ "attention_probs_dropout_prob": 0.1,
12
+ "bos_token_id": 100000,
13
+ "eos_token_id": 100001,
14
+ "head_dim": 8,
15
+ "hidden_act": "gelu",
16
+ "hidden_dropout_prob": 0.1,
17
+ "hidden_size": 32,
18
+ "id2label": {
19
+ "0": "LABEL_0",
20
+ "1": "LABEL_1",
21
+ "2": "LABEL_2"
22
+ },
23
+ "initializer_range": 0.02,
24
+ "intermediate_size": 37,
25
+ "is_training": true,
26
+ "label2id": {
27
+ "LABEL_0": 0,
28
+ "LABEL_1": 1,
29
+ "LABEL_2": 2
30
+ },
31
+ "max_position_embeddings": 512,
32
+ "mlp_bias": false,
33
+ "model_type": "llama",
34
+ "num_attention_heads": 4,
35
+ "num_choices": 4,
36
+ "num_hidden_layers": 2,
37
+ "num_key_value_heads": 4,
38
+ "pad_token_id": 100002,
39
+ "pretraining_tp": 1,
40
+ "rms_norm_eps": 1e-06,
41
+ "rope_parameters": {
42
+ "rope_theta": 10000.0,
43
+ "rope_type": "default"
44
+ },
45
+ "seq_length": 7,
46
+ "tie_word_embeddings": false,
47
+ "type_sequence_label_size": 2,
48
+ "type_vocab_size": 16,
49
+ "use_cache": true,
50
+ "use_input_mask": true,
51
+ "use_labels": true,
52
+ "use_token_type_ids": false,
53
+ "vocab_size": 100590
54
+ },
55
+ "tie_word_embeddings": true,
56
+ "transformers_version": "5.16.0.dev0",
57
+ "vision_config": {
58
+ "attention_bias": true,
59
+ "attention_dropout": 0.1,
60
+ "depth": 2,
61
+ "dropout": 0.1,
62
+ "hidden_act": "gelu",
63
+ "hidden_dropout_rate": 0.0,
64
+ "hidden_size": 32,
65
+ "image_size": 20,
66
+ "initializer_range": 0.02,
67
+ "is_training": true,
68
+ "layer_norm_eps": 1e-06,
69
+ "mlp_ratio": 2,
70
+ "model_type": "janus_vision_model",
71
+ "num_attention_heads": 4,
72
+ "num_channels": 3,
73
+ "num_hidden_layers": 2,
74
+ "num_image_tokens": 16,
75
+ "num_key_value_heads": 1,
76
+ "patch_size": 5,
77
+ "projection_dim": 32,
78
+ "projection_dropout": 0.0,
79
+ "use_labels": true,
80
+ "use_qk_norm": false,
81
+ "vision_feature_layer": -1,
82
+ "vision_feature_select_strategy": "default"
83
+ },
84
+ "vq_config": {
85
+ "base_channels": 32,
86
+ "channel_multiplier": [
87
+ 1,
88
+ 1
89
+ ],
90
+ "double_latent": false,
91
+ "dropout": 0.0,
92
+ "embed_dim": 12,
93
+ "hidden_act": "gelu",
94
+ "image_token_embed_dim": 32,
95
+ "in_channels": 3,
96
+ "initializer_range": 0.02,
97
+ "latent_channels": 12,
98
+ "model_type": "janus_vqgan",
99
+ "num_embeddings": 12,
100
+ "num_hidden_layers": 2,
101
+ "num_patches": 4,
102
+ "num_res_blocks": 2,
103
+ "out_channels": 3,
104
+ "projection_dim": 10
105
+ }
106
+ }
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": 100002,
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:6e472eb5c93375ff58e20710722694eed4e5a2632892cae055233f233b9de0a3
3
+ size 14335060
preprocessor_config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "background_color": [
3
+ 127,
4
+ 127,
5
+ 127
6
+ ],
7
+ "crop_size": {
8
+ "height": 20,
9
+ "width": 20
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": "JanusImageProcessor",
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": 20,
31
+ "width": 20
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,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": null,
3
+ "backend": "tokenizers",
4
+ "boi_token": "<begin_of_image>",
5
+ "bos_token": "<|begin▁of▁sentence|>",
6
+ "clean_up_tokenization_spaces": false,
7
+ "eoi_token": "<end_of_image>",
8
+ "eos_token": "<|end▁of▁sentence|>",
9
+ "image_token": "<image_placeholder>",
10
+ "is_local": true,
11
+ "legacy": true,
12
+ "local_files_only": false,
13
+ "model_max_length": 16384,
14
+ "model_specific_special_tokens": {
15
+ "boi_token": "<begin_of_image>",
16
+ "eoi_token": "<end_of_image>",
17
+ "image_token": "<image_placeholder>"
18
+ },
19
+ "pad_token": "<|▁pad▁|>",
20
+ "padding_side": "left",
21
+ "processor_class": "JanusProcessor",
22
+ "tokenizer_class": "TokenizersBackend",
23
+ "unk_token": null,
24
+ "use_default_system_prompt": true
25
+ }