Commit
·
77997f1
verified
·
0
Parent(s):
Duplicate from llava-hf/llava-interleave-qwen-0.5b-hf
Browse filesCo-authored-by: Raushan Turganbay <[email protected]>
- .gitattributes +35 -0
- LICENSE +53 -0
- README.md +208 -0
- added_tokens.json +6 -0
- chat_template.json +3 -0
- config.json +47 -0
- generation_config.json +6 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- onnx/decoder_model_merged.onnx +3 -0
- onnx/decoder_model_merged_bnb4.onnx +3 -0
- onnx/decoder_model_merged_fp16.onnx +3 -0
- onnx/decoder_model_merged_int8.onnx +3 -0
- onnx/decoder_model_merged_q4.onnx +3 -0
- onnx/decoder_model_merged_q4f16.onnx +3 -0
- onnx/decoder_model_merged_quantized.onnx +3 -0
- onnx/decoder_model_merged_uint8.onnx +3 -0
- onnx/embed_tokens.onnx +3 -0
- onnx/embed_tokens_bnb4.onnx +3 -0
- onnx/embed_tokens_fp16.onnx +3 -0
- onnx/embed_tokens_int8.onnx +3 -0
- onnx/embed_tokens_q4.onnx +3 -0
- onnx/embed_tokens_q4f16.onnx +3 -0
- onnx/embed_tokens_quantized.onnx +3 -0
- onnx/embed_tokens_uint8.onnx +3 -0
- onnx/vision_encoder.onnx +3 -0
- onnx/vision_encoder_bnb4.onnx +3 -0
- onnx/vision_encoder_fp16.onnx +3 -0
- onnx/vision_encoder_int8.onnx +3 -0
- onnx/vision_encoder_q4.onnx +3 -0
- onnx/vision_encoder_q4f16.onnx +3 -0
- onnx/vision_encoder_quantized.onnx +3 -0
- onnx/vision_encoder_uint8.onnx +3 -0
- preprocessor_config.json +24 -0
- special_tokens_map.json +20 -0
- tokenizer.json +0 -0
- tokenizer_config.json +52 -0
- vocab.json +0 -0
.gitattributes
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz 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
|
LICENSE
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Tongyi Qianwen RESEARCH LICENSE AGREEMENT
|
2 |
+
|
3 |
+
Tongyi Qianwen Release Date: November 30, 2023
|
4 |
+
|
5 |
+
By clicking to agree or by using or distributing any portion or element of the Tongyi Qianwen Materials, you will be deemed to have recognized and accepted the content of this Agreement, which is effective immediately.
|
6 |
+
|
7 |
+
1. Definitions
|
8 |
+
a. This Tongyi Qianwen RESEARCH LICENSE AGREEMENT (this "Agreement") shall mean the terms and conditions for use, reproduction, distribution and modification of the Materials as defined by this Agreement.
|
9 |
+
b. "We"(or "Us") shall mean Alibaba Cloud.
|
10 |
+
c. "You" (or "Your") shall mean a natural person or legal entity exercising the rights granted by this Agreement and/or using the Materials for any purpose and in any field of use.
|
11 |
+
d. "Third Parties" shall mean individuals or legal entities that are not under common control with Us or You.
|
12 |
+
e. "Tongyi Qianwen" shall mean the large language models, and software and algorithms, consisting of trained model weights, parameters (including optimizer states), machine-learning model code, inference-enabling code, training-enabling code, fine-tuning enabling code and other elements of the foregoing distributed by Us.
|
13 |
+
f. "Materials" shall mean, collectively, Alibaba Cloud's proprietary Tongyi Qianwen and Documentation (and any portion thereof) made available under this Agreement.
|
14 |
+
g. "Source" form shall mean the preferred form for making modifications, including but not limited to model source code, documentation source, and configuration files.
|
15 |
+
h. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation,
|
16 |
+
and conversions to other media types.
|
17 |
+
i. "Non-Commercial" shall mean for research or evaluation purposes only.
|
18 |
+
|
19 |
+
2. Grant of Rights
|
20 |
+
a. You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Alibaba Cloud's intellectual property or other rights owned by Us embodied in the Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the Materials FOR NON-COMMERCIAL PURPOSES ONLY.
|
21 |
+
b. If you are commercially using the Materials, You shall request a license from Us.
|
22 |
+
|
23 |
+
3. Redistribution
|
24 |
+
You may reproduce and distribute copies of the Materials or derivative works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
25 |
+
a. You shall give any other recipients of the Materials or derivative works a copy of this Agreement;
|
26 |
+
b. You shall cause any modified files to carry prominent notices stating that You changed the files;
|
27 |
+
c. You shall retain in all copies of the Materials that You distribute the following attribution notices within a "Notice" text file distributed as a part of such copies: "Tongyi Qianwen is licensed under the Tongyi Qianwen RESEARCH LICENSE AGREEMENT, Copyright (c) Alibaba Cloud. All Rights Reserved."; and
|
28 |
+
d. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such derivative works as a whole, provided Your use, reproduction, and distribution of the work otherwise complies with the terms and conditions of this Agreement.
|
29 |
+
|
30 |
+
4. Rules of use
|
31 |
+
a. The Materials may be subject to export controls or restrictions in China, the United States or other countries or regions. You shall comply with applicable laws and regulations in your use of the Materials.
|
32 |
+
b. You can not use the Materials or any output therefrom to improve any other large language model (excluding Tongyi Qianwen or derivative works thereof).
|
33 |
+
|
34 |
+
5. Intellectual Property
|
35 |
+
a. We retain ownership of all intellectual property rights in and to the Materials and derivatives made by or for Us. Conditioned upon compliance with the terms and conditions of this Agreement, with respect to any derivative works and modifications of the Materials that are made by you, you are and will be the owner of such derivative works and modifications.
|
36 |
+
b. No trademark license is granted to use the trade names, trademarks, service marks, or product names of Us, except as required to fulfill notice requirements under this Agreement or as required for reasonable and customary use in describing and redistributing the Materials.
|
37 |
+
c. If you commence a lawsuit or other proceedings (including a cross-claim or counterclaim in a lawsuit) against Us or any entity alleging that the Materials or any output therefrom, or any part of the foregoing, infringe any intellectual property or other right owned or licensable by you, then all licences granted to you under this Agreement shall terminate as of the date such lawsuit or other proceeding is commenced or brought.
|
38 |
+
6. Disclaimer of Warranty and Limitation of Liability
|
39 |
+
a. We are not obligated to support, update, provide training for, or develop any further version of the Tongyi Qianwen Materials or to grant any license thereto.
|
40 |
+
b. THE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. WE MAKE NO WARRANTY AND ASSUME NO RESPONSIBILITY FOR THE SAFETY OR STABILITY OF THE MATERIALS AND ANY OUTPUT THEREFROM.
|
41 |
+
c. IN NO EVENT SHALL WE BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE MATERIALS OR ANY OUTPUT OF IT, NO MATTER HOW IT’S CAUSED.
|
42 |
+
d. You will defend, indemnify and hold harmless Us from and against any claim by any third party arising out of or related to your use or distribution of the Materials.
|
43 |
+
|
44 |
+
7. Survival and Termination.
|
45 |
+
a. The term of this Agreement shall commence upon your acceptance of this Agreement or access to the Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein.
|
46 |
+
b. We may terminate this Agreement if you breach any of the terms or conditions of this Agreement. Upon termination of this Agreement, you must delete and cease use of the Materials. Sections 6 and 8 shall survive the termination of this Agreement.
|
47 |
+
|
48 |
+
8. Governing Law and Jurisdiction.
|
49 |
+
a. This Agreement and any dispute arising out of or relating to it will be governed by the laws of China, without regard to conflict of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
|
50 |
+
b. The People's Courts in Hangzhou City shall have exclusive jurisdiction over any dispute arising out of this Agreement.
|
51 |
+
9. Other Terms and Conditions.
|
52 |
+
a. Any arrangements, understandings, or agreements regarding the Material not stated herein are separate from and independent of the terms and conditions of this Agreement. You shall request a seperate license from Us, if You use the Materials in ways not expressly agreed to in this Agreement.
|
53 |
+
b. We shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
|
README.md
ADDED
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: tongyi-qianwen-research
|
4 |
+
license_link: LICENSE
|
5 |
+
pipeline_tag: image-text-to-text
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
tags:
|
9 |
+
- vision
|
10 |
+
- image-text-to-text
|
11 |
+
---
|
12 |
+
|
13 |
+
# LLaVA Interleave Model Card
|
14 |
+
|
15 |
+
## Model Details
|
16 |
+
|
17 |
+
|
18 |
+
**Model type:**
|
19 |
+
LLaVA Interleave is an open-source chatbot trained by fine-tuning LLM on multimodal instruction-following data. It is an auto-regressive language model, based on the transformer architecture.
|
20 |
+
Base LLM: [Qwen/Qwen1.5-7B-Chat](https://huggingface.co/Qwen/Qwen1.5-0.5B-Chat)
|
21 |
+
|
22 |
+
**Paper or resources for more information:**
|
23 |
+
https://llava-vl.github.io/
|
24 |
+
|
25 |
+
**Primary intended uses:**
|
26 |
+
The primary use of LLaVA-Next Interleave is research on large multimodal models and chatbots. This is only for research exploration, and prohibited for commercial usage.
|
27 |
+
|
28 |
+
**Primary intended users:**
|
29 |
+
The primary intended users of the model are researchers and hobbyists in computer vision, natural language processing, machine learning, and artificial intelligence.
|
30 |
+
|
31 |
+
|
32 |
+
## How to use the model
|
33 |
+
|
34 |
+
First, make sure to have `transformers >= 4.35.3`.
|
35 |
+
The model supports multi-image and multi-prompt generation. Meaning that you can pass multiple images in your prompt. Make sure also to follow the correct prompt template (`USER: xxx\nASSISTANT:`) and add the token `<image>` to the location where you want to query images:
|
36 |
+
|
37 |
+
### Using `pipeline`:
|
38 |
+
|
39 |
+
Below we used [`"llava-hf/llava-interleave-qwen-0.5b-hf"`](https://huggingface.co/llava-hf/llava-interleave-qwen-0.5b-hf) checkpoint.
|
40 |
+
|
41 |
+
|
42 |
+
```python
|
43 |
+
from transformers import pipeline
|
44 |
+
from PIL import Image
|
45 |
+
import requests
|
46 |
+
|
47 |
+
model_id = "llava-hf/llava-interleave-qwen-0.5b-dpo-hf"
|
48 |
+
pipe = pipeline("image-to-text", model=model_id)
|
49 |
+
|
50 |
+
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg"
|
51 |
+
image = Image.open(requests.get(url, stream=True).raw)
|
52 |
+
|
53 |
+
# Define a chat histiry and use `apply_chat_template` to get correctly formatted prompt
|
54 |
+
# Each value in "content" has to be a list of dicts with types ("text", "image")
|
55 |
+
conversation = [
|
56 |
+
{
|
57 |
+
|
58 |
+
"role": "user",
|
59 |
+
"content": [
|
60 |
+
{"type": "text", "text": "What does the label 15 represent? (1) lava (2) core (3) tunnel (4) ash cloud"},
|
61 |
+
{"type": "image"},
|
62 |
+
],
|
63 |
+
},
|
64 |
+
]
|
65 |
+
prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
|
66 |
+
|
67 |
+
outputs = pipe(image, prompt=prompt, generate_kwargs={"max_new_tokens": 200})
|
68 |
+
print(outputs)
|
69 |
+
```
|
70 |
+
|
71 |
+
### Using pure `transformers`:
|
72 |
+
|
73 |
+
Below is an example script to run generation in `float16` precision on a GPU device:
|
74 |
+
|
75 |
+
```python
|
76 |
+
import requests
|
77 |
+
from PIL import Image
|
78 |
+
|
79 |
+
import torch
|
80 |
+
from transformers import AutoProcessor, LlavaForConditionalGeneration
|
81 |
+
|
82 |
+
model_id = "llava-hf/llava-interleave-qwen-0.5b-dpo-hf"
|
83 |
+
model = LlavaForConditionalGeneration.from_pretrained(
|
84 |
+
model_id,
|
85 |
+
torch_dtype=torch.float16,
|
86 |
+
low_cpu_mem_usage=True,
|
87 |
+
).to(0)
|
88 |
+
|
89 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
90 |
+
|
91 |
+
# Define a chat histiry and use `apply_chat_template` to get correctly formatted prompt
|
92 |
+
# Each value in "content" has to be a list of dicts with types ("text", "image")
|
93 |
+
conversation = [
|
94 |
+
{
|
95 |
+
|
96 |
+
"role": "user",
|
97 |
+
"content": [
|
98 |
+
{"type": "text", "text": "What are these?"},
|
99 |
+
{"type": "image"},
|
100 |
+
],
|
101 |
+
},
|
102 |
+
]
|
103 |
+
prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
|
104 |
+
|
105 |
+
image_file = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
106 |
+
raw_image = Image.open(requests.get(image_file, stream=True).raw)
|
107 |
+
inputs = processor(prompt, raw_image, return_tensors='pt').to(0, torch.float16)
|
108 |
+
|
109 |
+
output = model.generate(**inputs, max_new_tokens=200, do_sample=False)
|
110 |
+
print(processor.decode(output[0][2:], skip_special_tokens=True))
|
111 |
+
```
|
112 |
+
|
113 |
+
|
114 |
+
When prompting with videos/3D/multi-view input, prompt like following:
|
115 |
+
|
116 |
+
```python
|
117 |
+
# if you downsampled n frames from the input
|
118 |
+
|
119 |
+
image_tokens = "<image>" * n
|
120 |
+
prompt = f"<|im_start|>user {image_tokens}\nWhat are these?|im_end|><|im_start|>assistant"
|
121 |
+
|
122 |
+
# With chat template if you sampled 5 frames you have to have 5 images in one conversation turn
|
123 |
+
conversation = [
|
124 |
+
{
|
125 |
+
|
126 |
+
"role": "user",
|
127 |
+
"content": [
|
128 |
+
{"type": "text", "text": "What are these?"},
|
129 |
+
{"type": "image"},
|
130 |
+
{"type": "image"},
|
131 |
+
{"type": "image"},
|
132 |
+
{"type": "image"},
|
133 |
+
{"type": "image"},
|
134 |
+
],
|
135 |
+
},
|
136 |
+
]
|
137 |
+
prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
|
138 |
+
```
|
139 |
+
|
140 |
+
When prompting with interleaved images and videos, prompt like following:
|
141 |
+
|
142 |
+
```python
|
143 |
+
# two interleaved images
|
144 |
+
prompt = "<|im_start|>user <image><image>\nWhat is the difference between these two images?|im_end|><|im_start|>assistant"
|
145 |
+
|
146 |
+
# two interleaved videos, if you downsampled n frames in total from both videos
|
147 |
+
image_tokens = "<image>" * n
|
148 |
+
prompt = f"<|im_start|>user {image_tokens}\nWhat are these?|im_end|><|im_start|>assistant"
|
149 |
+
|
150 |
+
# chat template in interleaved format work same as in sampling videos. Just pass in as many images you want for a prompt
|
151 |
+
conversation = [
|
152 |
+
{
|
153 |
+
|
154 |
+
"role": "user",
|
155 |
+
"content": [
|
156 |
+
{"type": "text", "text": "What is the difference between these two images?"},
|
157 |
+
{"type": "image"},
|
158 |
+
{"type": "image"},
|
159 |
+
],
|
160 |
+
},
|
161 |
+
]
|
162 |
+
```
|
163 |
+
|
164 |
+
### Model optimization
|
165 |
+
|
166 |
+
#### 4-bit quantization through `bitsandbytes` library
|
167 |
+
|
168 |
+
First make sure to install `bitsandbytes`, `pip install bitsandbytes` and make sure to have access to a CUDA compatible GPU device. Simply change the snippet above with:
|
169 |
+
|
170 |
+
```diff
|
171 |
+
model = LlavaForConditionalGeneration.from_pretrained(
|
172 |
+
model_id,
|
173 |
+
torch_dtype=torch.float16,
|
174 |
+
low_cpu_mem_usage=True,
|
175 |
+
+ load_in_4bit=True
|
176 |
+
)
|
177 |
+
```
|
178 |
+
|
179 |
+
#### Use Flash-Attention 2 to further speed-up generation
|
180 |
+
|
181 |
+
First make sure to install `flash-attn`. Refer to the [original repository of Flash Attention](https://github.com/Dao-AILab/flash-attention) regarding that package installation. Simply change the snippet above with:
|
182 |
+
|
183 |
+
```diff
|
184 |
+
model = LlavaForConditionalGeneration.from_pretrained(
|
185 |
+
model_id,
|
186 |
+
torch_dtype=torch.float16,
|
187 |
+
low_cpu_mem_usage=True,
|
188 |
+
+ use_flash_attention_2=True
|
189 |
+
).to(0)
|
190 |
+
```
|
191 |
+
|
192 |
+
### License Notices
|
193 |
+
|
194 |
+
This project utilizes certain datasets and checkpoints that are subject to their respective original licenses. Users must comply with all terms and conditions of these original licenses, including but not limited to the OpenAI Terms of Use for the dataset and the specific licenses for base language models for checkpoints trained using the dataset [Tongyi Qianwen LICENSE AGREEMENT](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT) and [META LLAMA 3 COMMUNITY LICENSE AGREEMENT](https://llama.meta.com/llama3/license/)). This project does not impose any additional constraints beyond those stipulated in the original licenses. Furthermore, users are reminded to ensure that their use of the dataset and checkpoints is in compliance with all applicable laws and regulations.
|
195 |
+
|
196 |
+
### Bibtext citation
|
197 |
+
|
198 |
+
```bibtext
|
199 |
+
@misc{li2024llavanextinterleavetacklingmultiimagevideo,
|
200 |
+
title={LLaVA-NeXT-Interleave: Tackling Multi-image, Video, and 3D in Large Multimodal Models},
|
201 |
+
author={Feng Li and Renrui Zhang and Hao Zhang and Yuanhan Zhang and Bo Li and Wei Li and Zejun Ma and Chunyuan Li},
|
202 |
+
year={2024},
|
203 |
+
eprint={2407.07895},
|
204 |
+
archivePrefix={arXiv},
|
205 |
+
primaryClass={cs.CV},
|
206 |
+
url={https://arxiv.org/abs/2407.07895},
|
207 |
+
}
|
208 |
+
```
|
added_tokens.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<image>": 151646,
|
3 |
+
"<|endoftext|>": 151643,
|
4 |
+
"<|im_end|>": 151645,
|
5 |
+
"<|im_start|>": 151644
|
6 |
+
}
|
chat_template.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n'}}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>' }}{% endfor %}{# Render all text next #}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ '\n' + content['text'] }}{% endfor %}{{'<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}"
|
3 |
+
}
|
config.json
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"LlavaForConditionalGeneration"
|
4 |
+
],
|
5 |
+
"ignore_index": -100,
|
6 |
+
"image_token_index": 151646,
|
7 |
+
"model_type": "llava",
|
8 |
+
"projector_hidden_act": "gelu",
|
9 |
+
"text_config": {
|
10 |
+
"_name_or_path": "Qwen/Qwen1.5-0.5B-Chat",
|
11 |
+
"architectures": [
|
12 |
+
"Qwen2ForCausalLM"
|
13 |
+
],
|
14 |
+
"bos_token_id": 151643,
|
15 |
+
"eos_token_id": 151645,
|
16 |
+
"hidden_size": 1024,
|
17 |
+
"intermediate_size": 2816,
|
18 |
+
"max_position_embeddings": 32768,
|
19 |
+
"max_window_layers": 21,
|
20 |
+
"model_type": "qwen2",
|
21 |
+
"num_attention_heads": 16,
|
22 |
+
"num_hidden_layers": 24,
|
23 |
+
"num_key_value_heads": 16,
|
24 |
+
"rope_theta": 1000000.0,
|
25 |
+
"sliding_window": 32768,
|
26 |
+
"tie_word_embeddings": true,
|
27 |
+
"torch_dtype": "bfloat16",
|
28 |
+
"use_sliding_window": false,
|
29 |
+
"vocab_size": 152000
|
30 |
+
},
|
31 |
+
"torch_dtype": "bfloat16",
|
32 |
+
"transformers_version": "4.43.0.dev0",
|
33 |
+
"vision_config": {
|
34 |
+
"hidden_act": "gelu_pytorch_tanh",
|
35 |
+
"hidden_size": 1152,
|
36 |
+
"image_size": 384,
|
37 |
+
"intermediate_size": 4304,
|
38 |
+
"layer_norm_eps": 1e-06,
|
39 |
+
"model_type": "siglip_vision_model",
|
40 |
+
"num_attention_heads": 16,
|
41 |
+
"num_hidden_layers": 26,
|
42 |
+
"patch_size": 14,
|
43 |
+
"vision_use_head": false
|
44 |
+
},
|
45 |
+
"vision_feature_layer": -1,
|
46 |
+
"vision_feature_select_strategy": "full"
|
47 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 151643,
|
4 |
+
"eos_token_id": 151645,
|
5 |
+
"transformers_version": "4.43.0.dev0"
|
6 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ec7b02696781afdb1f27871fdffe0f71ef030932d10fbd759bc59392669605f7
|
3 |
+
size 1728158072
|
onnx/decoder_model_merged.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2cabb6abc10eb031ccad2b9af8aaf3d6d85f03ed483624025e6b547597c8a9e1
|
3 |
+
size 1873661100
|
onnx/decoder_model_merged_bnb4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f12a8bdc439aadbb877b190d6c914b382f5ab83fceafa0ed543865af718db7b2
|
3 |
+
size 278930368
|
onnx/decoder_model_merged_fp16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:56a413580b17618a2091a25fd0531b2e58921417eae7f8da0d6bf2f4cdc66863
|
3 |
+
size 937181737
|
onnx/decoder_model_merged_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1441da7dc9ca13061dff09afd0a1c1a4d5a3c70a15a92d28e3b20b3df5a2b130
|
3 |
+
size 482057151
|
onnx/decoder_model_merged_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:21a8dcf948500795c2c35e1445d4a6402c73b3e0e83178254a09e7ea93809c72
|
3 |
+
size 307924600
|
onnx/decoder_model_merged_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7fbebfa169f26e6d578b55ad90b3ee7d263be536e74ff1ae9c65f9df93429ebc
|
3 |
+
size 270308341
|
onnx/decoder_model_merged_quantized.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1441da7dc9ca13061dff09afd0a1c1a4d5a3c70a15a92d28e3b20b3df5a2b130
|
3 |
+
size 482057151
|
onnx/decoder_model_merged_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1b865d204c072ec0ba5b96f567e6c2545860d42d467deb738932fa8c955dbdd6
|
3 |
+
size 482057238
|
onnx/embed_tokens.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:460a64e8f286b6cebad913035ea0554396e427e7fd7bfcb9633d6d3383e525bf
|
3 |
+
size 622592239
|
onnx/embed_tokens_bnb4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3adc98e92f4a67ef47b45137c84f0a416c6f3affbd718bb81f10e51b40336f2e
|
3 |
+
size 622592258
|
onnx/embed_tokens_fp16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4a256d4020d3edbf047dda795d9212da4aa0839c378665e291a26970f57cb5ec
|
3 |
+
size 311296389
|
onnx/embed_tokens_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9a38e5e83216d7921e0ce5391af4de30eb11c0a380915adacdae2bfcf43247ea
|
3 |
+
size 155648481
|
onnx/embed_tokens_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3adc98e92f4a67ef47b45137c84f0a416c6f3affbd718bb81f10e51b40336f2e
|
3 |
+
size 622592258
|
onnx/embed_tokens_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:08a57d97c1505251f8579d6579bfbe81cd3a2be2b255ef5f15943000fcd5628a
|
3 |
+
size 311296408
|
onnx/embed_tokens_quantized.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9a38e5e83216d7921e0ce5391af4de30eb11c0a380915adacdae2bfcf43247ea
|
3 |
+
size 155648481
|
onnx/embed_tokens_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3ab01b11174eb06975e6b3f42f9f3ed958ea4f41e38a7f60757c4af8e2d8f687
|
3 |
+
size 155648480
|
onnx/vision_encoder.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d42cfdb50dd623f35c522b04cc58317d27890d96d1b85e332ef94ad6e3fec704
|
3 |
+
size 1600491890
|
onnx/vision_encoder_bnb4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d335e190475f6bda9f0be317941545614c7f1cd50db99de8b94f4d78fcf90dda
|
3 |
+
size 232137832
|
onnx/vision_encoder_fp16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:55306600bdf39741a4e8321d5191d4fe38b711fd9db58ee86eb28849ff797dec
|
3 |
+
size 800540208
|
onnx/vision_encoder_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1dc484349699feab4a339613870239b4eea1d8a474123a48127c1712136d2d7a
|
3 |
+
size 404477734
|
onnx/vision_encoder_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fd8a1ba9f31090bafbdaa7513f516876d43afd58e216b059c0190821ea970656
|
3 |
+
size 257315678
|
onnx/vision_encoder_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a27386a7d7bf14596fa8d59b06c8673882ab90011cca6cd23e5b85117976f3eb
|
3 |
+
size 228602140
|
onnx/vision_encoder_quantized.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81fe5c6c8c7101eb8174f685893e33d1bdbdda5f8b7d8dcf7953eff2f32966a0
|
3 |
+
size 404477816
|
onnx/vision_encoder_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81fe5c6c8c7101eb8174f685893e33d1bdbdda5f8b7d8dcf7953eff2f32966a0
|
3 |
+
size 404477816
|
preprocessor_config.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_convert_rgb": null,
|
3 |
+
"do_normalize": true,
|
4 |
+
"do_rescale": true,
|
5 |
+
"do_resize": true,
|
6 |
+
"image_mean": [
|
7 |
+
0.5,
|
8 |
+
0.5,
|
9 |
+
0.5
|
10 |
+
],
|
11 |
+
"image_processor_type": "SiglipImageProcessor",
|
12 |
+
"image_std": [
|
13 |
+
0.5,
|
14 |
+
0.5,
|
15 |
+
0.5
|
16 |
+
],
|
17 |
+
"processor_class": "LlavaProcessor",
|
18 |
+
"resample": 3,
|
19 |
+
"rescale_factor": 0.00392156862745098,
|
20 |
+
"size": {
|
21 |
+
"height": 384,
|
22 |
+
"width": 384
|
23 |
+
}
|
24 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<|im_start|>",
|
4 |
+
"<|im_end|>"
|
5 |
+
],
|
6 |
+
"eos_token": {
|
7 |
+
"content": "<|im_end|>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false
|
12 |
+
},
|
13 |
+
"pad_token": {
|
14 |
+
"content": "<|endoftext|>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
}
|
20 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"added_tokens_decoder": {
|
4 |
+
"151643": {
|
5 |
+
"content": "<|endoftext|>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": false,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false,
|
10 |
+
"special": true
|
11 |
+
},
|
12 |
+
"151644": {
|
13 |
+
"content": "<|im_start|>",
|
14 |
+
"lstrip": false,
|
15 |
+
"normalized": false,
|
16 |
+
"rstrip": false,
|
17 |
+
"single_word": false,
|
18 |
+
"special": true
|
19 |
+
},
|
20 |
+
"151645": {
|
21 |
+
"content": "<|im_end|>",
|
22 |
+
"lstrip": false,
|
23 |
+
"normalized": false,
|
24 |
+
"rstrip": false,
|
25 |
+
"single_word": false,
|
26 |
+
"special": true
|
27 |
+
},
|
28 |
+
"151646": {
|
29 |
+
"content": "<image>",
|
30 |
+
"lstrip": false,
|
31 |
+
"normalized": false,
|
32 |
+
"rstrip": false,
|
33 |
+
"single_word": false,
|
34 |
+
"special": true
|
35 |
+
}
|
36 |
+
},
|
37 |
+
"additional_special_tokens": [
|
38 |
+
"<|im_start|>",
|
39 |
+
"<|im_end|>"
|
40 |
+
],
|
41 |
+
"bos_token": null,
|
42 |
+
"chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
43 |
+
"clean_up_tokenization_spaces": false,
|
44 |
+
"eos_token": "<|im_end|>",
|
45 |
+
"errors": "replace",
|
46 |
+
"model_max_length": 32768,
|
47 |
+
"pad_token": "<|endoftext|>",
|
48 |
+
"processor_class": "LlavaProcessor",
|
49 |
+
"split_special_tokens": false,
|
50 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
51 |
+
"unk_token": null
|
52 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|