Add tiny processor fixture for testing
Browse files- .gitattributes +1 -0
- chat_template.jinja +5 -0
- config.json +82 -0
- generation_config.json +11 -0
- preprocessor_config.json +30 -0
- processor_config.json +4 -0
- tokenizer.json +0 -0
- tokenizer_config.json +0 -0
.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 |
+
janus_pro_teaser2.png filter=lfs diff=lfs merge=lfs -text
|
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,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"JanusForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"image_token_id": 100581,
|
| 6 |
+
"model_type": "janus",
|
| 7 |
+
"text_config": {
|
| 8 |
+
"attention_bias": false,
|
| 9 |
+
"attention_dropout": 0.0,
|
| 10 |
+
"bos_token_id": 100000,
|
| 11 |
+
"eos_token_id": 100001,
|
| 12 |
+
"head_dim": 128,
|
| 13 |
+
"hidden_act": "silu",
|
| 14 |
+
"hidden_size": 2048,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 5632,
|
| 17 |
+
"max_position_embeddings": 16384,
|
| 18 |
+
"mlp_bias": false,
|
| 19 |
+
"model_type": "llama",
|
| 20 |
+
"num_attention_heads": 16,
|
| 21 |
+
"num_hidden_layers": 24,
|
| 22 |
+
"num_key_value_heads": 16,
|
| 23 |
+
"pad_token_id": 100002,
|
| 24 |
+
"pretraining_tp": 1,
|
| 25 |
+
"rms_norm_eps": 1e-06,
|
| 26 |
+
"rope_scaling": null,
|
| 27 |
+
"rope_theta": 10000.0,
|
| 28 |
+
"torch_dtype": "bfloat16",
|
| 29 |
+
"use_cache": true,
|
| 30 |
+
"vocab_size": 102400
|
| 31 |
+
},
|
| 32 |
+
"torch_dtype": "bfloat16",
|
| 33 |
+
"transformers_version": "4.52.0.dev0",
|
| 34 |
+
"vision_config": {
|
| 35 |
+
"attention_bias": true,
|
| 36 |
+
"attention_dropout": 0.0,
|
| 37 |
+
"depth": 2,
|
| 38 |
+
"hidden_act": "gelu",
|
| 39 |
+
"hidden_dropout_rate": 0.0,
|
| 40 |
+
"hidden_size": 1024,
|
| 41 |
+
"image_size": 384,
|
| 42 |
+
"initializer_range": 0.02,
|
| 43 |
+
"layer_norm_eps": 1e-06,
|
| 44 |
+
"mlp_ratio": 4.0,
|
| 45 |
+
"model_type": "janus_vision_model",
|
| 46 |
+
"num_attention_heads": 16,
|
| 47 |
+
"num_channels": 3,
|
| 48 |
+
"num_hidden_layers": 24,
|
| 49 |
+
"num_image_tokens": 576,
|
| 50 |
+
"patch_size": 16,
|
| 51 |
+
"projection_dim": 2048,
|
| 52 |
+
"projection_dropout": 0.0,
|
| 53 |
+
"use_qk_norm": false
|
| 54 |
+
},
|
| 55 |
+
"vq_config": {
|
| 56 |
+
"base_channels": 128,
|
| 57 |
+
"channel_multiplier": [
|
| 58 |
+
1,
|
| 59 |
+
1,
|
| 60 |
+
2,
|
| 61 |
+
2,
|
| 62 |
+
4
|
| 63 |
+
],
|
| 64 |
+
"depth": 2,
|
| 65 |
+
"double_latent": false,
|
| 66 |
+
"dropout": 0.0,
|
| 67 |
+
"embed_dim": 8,
|
| 68 |
+
"hidden_act": "gelu",
|
| 69 |
+
"image_token_embed_dim": 2048,
|
| 70 |
+
"in_channels": 3,
|
| 71 |
+
"initializer_range": 0.02,
|
| 72 |
+
"latent_channels": 256,
|
| 73 |
+
"model_type": "janus_vqgan",
|
| 74 |
+
"num_embeddings": 16384,
|
| 75 |
+
"num_hidden_layers": 2,
|
| 76 |
+
"num_patches": 24,
|
| 77 |
+
"num_res_blocks": 2,
|
| 78 |
+
"out_channels": 3,
|
| 79 |
+
"projection_dim": 2048
|
| 80 |
+
},
|
| 81 |
+
"vocab_size": 500
|
| 82 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": false,
|
| 3 |
+
"bos_token_id": 100000,
|
| 4 |
+
"eos_token_id": 100001,
|
| 5 |
+
"generation_kwargs": {
|
| 6 |
+
"boi_token_id": 100003
|
| 7 |
+
},
|
| 8 |
+
"guidance_scale": 5,
|
| 9 |
+
"pad_token_id": 100002,
|
| 10 |
+
"transformers_version": "4.52.0.dev0"
|
| 11 |
+
}
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"background_color": [
|
| 3 |
+
127,
|
| 4 |
+
127,
|
| 5 |
+
127
|
| 6 |
+
],
|
| 7 |
+
"do_convert_rgb": null,
|
| 8 |
+
"do_normalize": true,
|
| 9 |
+
"do_rescale": true,
|
| 10 |
+
"do_resize": true,
|
| 11 |
+
"image_mean": [
|
| 12 |
+
0.5,
|
| 13 |
+
0.5,
|
| 14 |
+
0.5
|
| 15 |
+
],
|
| 16 |
+
"image_processor_type": "JanusImageProcessor",
|
| 17 |
+
"image_std": [
|
| 18 |
+
0.5,
|
| 19 |
+
0.5,
|
| 20 |
+
0.5
|
| 21 |
+
],
|
| 22 |
+
"min_size": 14,
|
| 23 |
+
"processor_class": "JanusProcessor",
|
| 24 |
+
"resample": 3,
|
| 25 |
+
"rescale_factor": 0.00392156862745098,
|
| 26 |
+
"size": {
|
| 27 |
+
"height": 384,
|
| 28 |
+
"width": 384
|
| 29 |
+
}
|
| 30 |
+
}
|
processor_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"processor_class": "JanusProcessor",
|
| 3 |
+
"use_default_system_prompt": true
|
| 4 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|