Upload folder using huggingface_hub
Browse files- README.md +60 -0
- config.json +17 -0
- janus_pro_teaser1.png +0 -0
- janus_pro_teaser2.png +0 -0
- model.safetensors +3 -0
- preprocessor_config.json +23 -0
- processor_config.json +9 -0
- special_tokens_map.json +16 -0
- tokenizer.json +0 -0
- tokenizer_config.json +11 -0
README.md
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
license_name: deepseek
|
4 |
+
license_link: LICENSE
|
5 |
+
pipeline_tag: any-to-any
|
6 |
+
library_name: transformers
|
7 |
+
tags:
|
8 |
+
- muiltimodal
|
9 |
+
- text-to-image
|
10 |
+
- unified-model
|
11 |
+
---
|
12 |
+
|
13 |
+
## 1. Introduction
|
14 |
+
|
15 |
+
Janus-Pro is a novel autoregressive framework that unifies multimodal understanding and generation.
|
16 |
+
It addresses the limitations of previous approaches by decoupling visual encoding into separate pathways, while still utilizing a single, unified transformer architecture for processing. The decoupling not only alleviates the conflict between the visual encoder’s roles in understanding and generation, but also enhances the framework’s flexibility.
|
17 |
+
Janus-Pro surpasses previous unified model and matches or exceeds the performance of task-specific models.
|
18 |
+
The simplicity, high flexibility, and effectiveness of Janus-Pro make it a strong candidate for next-generation unified multimodal models.
|
19 |
+
|
20 |
+
[**Github Repository**](https://github.com/deepseek-ai/Janus)
|
21 |
+
|
22 |
+
<div align="center">
|
23 |
+
<img alt="image" src="janus_pro_teaser1.png" style="width:90%;">
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<div align="center">
|
27 |
+
<img alt="image" src="janus_pro_teaser2.png" style="width:90%;">
|
28 |
+
</div>
|
29 |
+
|
30 |
+
|
31 |
+
### 2. Model Summary
|
32 |
+
|
33 |
+
Janus-Pro is a unified understanding and generation MLLM, which decouples visual encoding for multimodal understanding and generation.
|
34 |
+
Janus-Pro is constructed based on the DeepSeek-LLM-1.5b-base/DeepSeek-LLM-7b-base.
|
35 |
+
|
36 |
+
For multimodal understanding, it uses the [SigLIP-L](https://huggingface.co/timm/ViT-L-16-SigLIP-384) as the vision encoder, which supports 384 x 384 image input. For image generation, Janus-Pro uses the tokenizer from [here](https://github.com/FoundationVision/LlamaGen) with a downsample rate of 16.
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
## 3. Quick Start
|
41 |
+
|
42 |
+
Please refer to [**Github Repository**](https://github.com/deepseek-ai/Janus)
|
43 |
+
|
44 |
+
|
45 |
+
## 4. License
|
46 |
+
|
47 |
+
This code repository is licensed under [the MIT License](https://github.com/deepseek-ai/DeepSeek-LLM/blob/HEAD/LICENSE-CODE). The use of Janus-Pro models is subject to [DeepSeek Model License](https://github.com/deepseek-ai/DeepSeek-LLM/blob/HEAD/LICENSE-MODEL).
|
48 |
+
## 5. Citation
|
49 |
+
|
50 |
+
```
|
51 |
+
@misc{chen2025januspro,
|
52 |
+
title={Janus-Pro: Unified Multimodal Understanding and Generation with Data and Model Scaling},
|
53 |
+
author={Xiaokang Chen and Zhiyu Wu and Xingchao Liu and Zizheng Pan and Wen Liu and Zhenda Xie and Xingkai Yu and Chong Ruan},
|
54 |
+
year={2025},
|
55 |
+
}
|
56 |
+
```
|
57 |
+
|
58 |
+
## 6. Contact
|
59 |
+
|
60 |
+
If you have any questions, please raise an issue or contact us at [[email protected]](mailto:[email protected]).
|
config.json
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"LlamaForCausalLM"
|
4 |
+
],
|
5 |
+
"hidden_size": 2048,
|
6 |
+
"intermediate_size": 5632,
|
7 |
+
"max_position_embeddings": 16384,
|
8 |
+
"num_attention_heads": 16,
|
9 |
+
"num_hidden_layers": 24,
|
10 |
+
"num_key_value_heads": 16,
|
11 |
+
"rms_norm_eps": 1e-6,
|
12 |
+
"vocab_size": 102400,
|
13 |
+
"model_type": "llama",
|
14 |
+
"torch_dtype": "bfloat16",
|
15 |
+
"tie_word_embeddings": false,
|
16 |
+
"transformers_version": "4.33.1"
|
17 |
+
}
|
janus_pro_teaser1.png
ADDED
![]() |
janus_pro_teaser2.png
ADDED
![]() |
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:efcc1d8298bb318589b99da88bf01dced77b4c0c5d660da0faa947b714cb06db
|
3 |
+
size 3305337400
|
preprocessor_config.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"background_color": [
|
3 |
+
127,
|
4 |
+
127,
|
5 |
+
127
|
6 |
+
],
|
7 |
+
"do_normalize": true,
|
8 |
+
"image_mean": [
|
9 |
+
0.5,
|
10 |
+
0.5,
|
11 |
+
0.5
|
12 |
+
],
|
13 |
+
"image_processor_type": "VLMImageProcessor",
|
14 |
+
"image_size": 384,
|
15 |
+
"image_std": [
|
16 |
+
0.5,
|
17 |
+
0.5,
|
18 |
+
0.5
|
19 |
+
],
|
20 |
+
"min_size": 14,
|
21 |
+
"processor_class": "VLChatProcessor",
|
22 |
+
"rescale_factor": 0.00392156862745098
|
23 |
+
}
|
processor_config.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_special_token": false,
|
3 |
+
"ignore_id": -100,
|
4 |
+
"image_tag": "<image_placeholder>",
|
5 |
+
"mask_prompt": true,
|
6 |
+
"num_image_tokens": 576,
|
7 |
+
"processor_class": "VLChatProcessor",
|
8 |
+
"sft_format": "deepseek"
|
9 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<image_placeholder>",
|
4 |
+
"<patch_placeholder>",
|
5 |
+
"<|ref|>",
|
6 |
+
"<|/ref|>",
|
7 |
+
"<|det|>",
|
8 |
+
"<|/det|>",
|
9 |
+
"<|grounding|>",
|
10 |
+
"<|User|>",
|
11 |
+
"<|Assistant|>"
|
12 |
+
],
|
13 |
+
"bos_token": "<|begin▁of▁sentence|>",
|
14 |
+
"eos_token": "<|end▁of▁sentence|>",
|
15 |
+
"pad_token": "<|▁pad▁|>"
|
16 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<|begin▁of▁sentence|>",
|
3 |
+
"clean_up_tokenization_spaces": false,
|
4 |
+
"eos_token": "<|end▁of▁sentence|>",
|
5 |
+
"model_max_length": 16384,
|
6 |
+
"pad_token": null,
|
7 |
+
"tokenizer_class": "LlamaTokenizer",
|
8 |
+
"unk_token": null,
|
9 |
+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{{'<|User|>: ' + message['content'] + '\\n\\n'}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>: ' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endfor -%}{% if add_generation_prompt %}{{'<|Assistant|>: '}}{% endif %}",
|
10 |
+
"use_default_system_prompt": true
|
11 |
+
}
|