Master-Shi commited on
Commit
b38d31d
·
verified ·
1 Parent(s): 13db0ce

Add files using upload-large-folder tool

Browse files
Files changed (20) hide show
  1. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/.dockerignore +21 -0
  2. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/.editorconfig +18 -0
  3. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/.gitattributes +29 -0
  4. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/.gitignore +73 -0
  5. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/LICENSE +201 -0
  6. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/README.md +247 -0
  7. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/cog.yaml +37 -0
  8. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/predict.py +146 -0
  9. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/pyproject.toml +101 -0
  10. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/requirements.txt +324 -0
  11. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/qwen.py +19 -0
  12. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/summarize_data.py +81 -0
  13. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/train/finetune_si.sh +73 -0
  14. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/train/single_image.yaml +187 -0
  15. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero2.json +41 -0
  16. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero2_fused_adamw.json +41 -0
  17. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero2_offload.json +31 -0
  18. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero3.json +41 -0
  19. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero3_offload.json +48 -0
  20. 之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero3pp.json +53 -0
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/.dockerignore ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # The .dockerignore file excludes files from the container build process.
2
+ #
3
+ # https://docs.docker.com/engine/reference/builder/#dockerignore-file
4
+
5
+ # Exclude Git files
6
+ .git
7
+ .github
8
+ .gitignore
9
+
10
+ # Exclude Python cache files
11
+ __pycache__
12
+ .mypy_cache
13
+ .pytest_cache
14
+ .ruff_cache
15
+
16
+ # Exclude Python virtual environment
17
+ /venv
18
+
19
+ # Exclude some weights
20
+ /openai
21
+ /liuhaotian
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/.editorconfig ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ root = true
2
+
3
+ # Unix-style newlines with a newline ending every file
4
+ [*]
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ charset = utf-8
9
+
10
+ # 4 space indentation
11
+ [*.{py,json}]
12
+ indent_style = space
13
+ indent_size = 4
14
+
15
+ # 2 space indentation
16
+ [*.{md,sh,yaml,yml}]
17
+ indent_style = space
18
+ indent_size = 2
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/.gitattributes ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # https://git-scm.com/docs/gitattributes
2
+
3
+ # Set the default behavior, in case people don't have core.autocrlf set.
4
+ # https://git-scm.com/docs/gitattributes#_end_of_line_conversion
5
+ * text=auto
6
+
7
+ # common python attributes, taken from https://github.com/alexkaratarakis/gitattributes/blob/710900479a2bedeec7003d381719521ffbb18bf8/Python.gitattributes
8
+ # Source files
9
+ # ============
10
+ *.pxd text diff=python
11
+ *.py text diff=python
12
+ *.py3 text diff=python
13
+ *.pyw text diff=python
14
+ *.pyx text diff=python
15
+ *.pyz text diff=python
16
+ *.pyi text diff=python
17
+
18
+ # Binary files
19
+ # ============
20
+ *.db binary
21
+ *.p binary
22
+ *.pkl binary
23
+ *.pickle binary
24
+ *.pyc binary export-ignore
25
+ *.pyo binary export-ignore
26
+ *.pyd binary
27
+
28
+ # Jupyter notebook
29
+ *.ipynb text eol=lf
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/.gitignore ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python
2
+ __pycache__
3
+ *.pyc
4
+ *.egg-info
5
+ dist
6
+
7
+ # Log
8
+ *.log
9
+ *.log.*
10
+ # *.json
11
+ # *.jsonl
12
+
13
+ # Data
14
+ !**/alpaca-data-conversation.json
15
+ # Editor
16
+ .idea
17
+ *.swp
18
+ .vscode
19
+
20
+ # Other
21
+ .DS_Store
22
+ wandb
23
+ output
24
+ llavavid
25
+
26
+ checkpoints
27
+ project_checkpoints
28
+ debug_checkpoints
29
+ playground/data
30
+ playground/cc3m_llava34b_cap
31
+ ckpts*
32
+
33
+ .ipynb_checkpoints
34
+ chunyl_scripts
35
+ *.ipynb
36
+
37
+ # DevContainer
38
+ !.devcontainer/*
39
+
40
+ # Demo
41
+ serve_images/
42
+ notebooks/
43
+ logs
44
+ scripts/dist_*
45
+ logs/
46
+ submissions/
47
+ cn_scripts/
48
+ internal_project_checkpoints/
49
+ work_dirs
50
+ scripts/i18n/*
51
+ playground/.nfs028b000000010add00000001
52
+ HIP
53
+ playground/.nfs028b0000017bff2c00000012
54
+ scripts/qwen
55
+ scripts/vicuna
56
+ scripts/mistral
57
+ scripts/baseline_rep
58
+ scripts/cn_boli01_hl
59
+ scripts/cn_boli01_lf
60
+ scripts/cn_lf
61
+ scripts/cn_lq
62
+ scripts/cn_yg
63
+ scripts/cn_yg_hao
64
+ scripts/eva_encoder
65
+ scripts/i18n
66
+ scripts/i18n_higher_res
67
+ scripts/multi-images
68
+ scratchpad
69
+ build/
70
+ playground/*.json
71
+ mlx_configs/
72
+ data_processing/
73
+ # demo/
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/README.md ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="center" width="100%">
2
+ <img src="https://i.postimg.cc/pL17YtG4/WX20240508-220230-2x.png" width="80%" height="80%">
3
+ </p>
4
+
5
+ # LLaVA-NeXT: Open Large Multimodal Models
6
+ [![Static Badge](https://img.shields.io/badge/llava_video-paper-green)](http://arxiv.org/abs/2410.02713)
7
+ [![Static Badge](https://img.shields.io/badge/llava_onevision-paper-green)](https://arxiv.org/abs/2408.03326)
8
+ [![llava_next-blog](https://img.shields.io/badge/llava_next-blog-green)](https://llava-vl.github.io/blog/)
9
+
10
+ [![llava_onevision-demo](https://img.shields.io/badge/llava_onevision-demo-red)](https://llava-onevision.lmms-lab.com/)
11
+ [![llava_next-video_demo](https://img.shields.io/badge/llava_video-demo-red)](https://huggingface.co/spaces/WildVision/vision-arena)
12
+ [![llava_next-interleave_demo](https://img.shields.io/badge/llava_next-interleave_demo-red)](https://huggingface.co/spaces/lmms-lab/LLaVA-NeXT-Interleave-Demo)
13
+ [![Openbayes Demo](https://img.shields.io/static/v1?label=Demo&message=OpenBayes%E8%B4%9D%E5%BC%8F%E8%AE%A1%E7%AE%97&color=green)](https://openbayes.com/console/public/tutorials/gW0ng9jKXfO)
14
+
15
+ [![llava_video-checkpoints](https://img.shields.io/badge/llava_video-checkpoints-blue)](https://huggingface.co/collections/lmms-lab/llava-next-video-661e86f5e8dabc3ff793c944)
16
+ [![llava_onevision-checkpoints](https://img.shields.io/badge/llava_onevision-checkpoints-blue)](https://huggingface.co/collections/lmms-lab/llava-onevision-66a259c3526e15166d6bba37)
17
+ [![llava_next-interleave_checkpoints](https://img.shields.io/badge/llava_next-interleave_checkpoints-blue)](https://huggingface.co/collections/lmms-lab/llava-next-interleave-66763c55c411b340b35873d1)
18
+ [![llava_next-image_checkpoints](https://img.shields.io/badge/llava_next-image_checkpoints-blue)](https://huggingface.co/lmms-lab)
19
+
20
+ ## Release Notes
21
+ - **[2025/08/29] 🔥 LLaVA-Critic-R1** We release LLaVA-Critic-R1, a family of generative critic VLM trained through GRPO using pairwise critic data. LLaVA-Critic-R1 not only demonstrates strong critic capability, but also achieves state-of-the-art policy performance at the 7B scale. Refer to [LLaVA-Critic-R1](llava-critic-r1/EasyR1/README.md) for more training details.
22
+
23
+ 📄 **Explore more**:
24
+ - [LLaVA-Critic-GRPO Dataset](https://huggingface.co/datasets/lmms-lab/LLaVA-Critic-GRPO-dataset): Download the dataset.
25
+ - [LLaVA-Critic-R1-7B](https://huggingface.co/lmms-lab/LLaVA-Critic-R1-7B): LLaVA-Critic-R1 trained based on Qwen-2.5-VL-7B.
26
+ - [LLaVA-Critic-R1-7B-Plus-Qwen](https://huggingface.co/lmms-lab/LLaVA-Critic-R1-7B-Plus-Qwen): LLaVA-Critic-R1+ trained based on ThinkLite-VL-7B.
27
+ - [LLaVA-Critic-R1-7B-Plus-Mimo](https://huggingface.co/lmms-lab/LLaVA-Critic-R1-7B-Plus-Mimo): LLaVA-Critic-R1+ trained based on MiMo-VL-7B-RL-2508.
28
+ - [LLaVA-Critic-R1-7B-Plus-LLaMA32v](https://huggingface.co/lmms-lab/LLaVA-Critic-R1-7B-LLaMA32v): LLaVA-Critic-R1+ trained based on Llama-3.2-11B-Vision-Instruct.
29
+ - [Paper](https://arxiv.org/abs/2509.00676): Detailed information about LLaVA-Critic-R1.
30
+
31
+
32
+ - **[2024/10/04] 🔥 LLaVA-Video** (formerly LLaVA-NeXT-Video) has undergone a major upgrade! We are excited to release **LLaVA-Video-178K**, a high-quality synthetic dataset for video instruction tuning. This dataset includes:
33
+
34
+ - 178,510 caption entries
35
+ - 960,792 open-ended Q&A pairs
36
+ - 196,198 multiple-choice Q&A items
37
+
38
+ Along with this, we’re also releasing the **LLaVA-Video 7B/72B models**, which deliver competitive performance on the latest video benchmarks, including [Video-MME](https://video-mme.github.io/home_page.html#leaderboard), [LongVideoBench](https://longvideobench.github.io/), and [Dream-1K](https://tarsier-vlm.github.io/).
39
+
40
+ 📄 **Explore more**:
41
+ - [LLaVA-Video-178K Dataset](https://huggingface.co/datasets/lmms-lab/LLaVA-Video-178K): Download the dataset.
42
+ - [LLaVA-Video Models](https://huggingface.co/collections/lmms-lab/llava-video-661e86f5e8dabc3ff793c944): Access model checkpoints.
43
+ - [Paper](http://arxiv.org/abs/2410.02713): Detailed information about LLaVA-Video.
44
+ - [LLaVA-Video Documentation](https://github.com/LLaVA-VL/LLaVA-NeXT/blob/main/docs/LLaVA_Video_1003.md): Guidance on training, inference and evaluation.
45
+
46
+ - [2024/09/13] 🔥 **🚀 [LLaVA-OneVision-Chat](docs/LLaVA_OneVision_Chat.md)**. The new LLaVA-OV-Chat (7B/72B) significantly improves the chat experience of LLaVA-OV. 📄
47
+
48
+ ![](docs/ov_chat_images/chat_results.png)
49
+
50
+ - [2024/08/06] 🔥 **🚀 [LLaVA-OneVision (OV)](https://llava-vl.github.io/blog/2024-08-05-llava-onevision/)!** The new LLaVA-OV models (0.5B/7B/72B) achieve new state-of-the-art performance across single-image, multi-image, and video benchmarks, sometimes rivaling top commercial models on 47 diverse benchmarks. 📄 Explore More:
51
+ * [[Paper]](https://arxiv.org/abs/2408.03326): In-depth insights, new emegerging scenarios, ie, strong video understadning through task transfer from images.
52
+ * [[LLaVA-OV Doc]](https://github.com/LLaVA-VL/LLaVA-NeXT/blob/main/docs/LLaVA_OneVision.md): Model inference and evaluation guidance.
53
+ * [[Scripts]](https://github.com/LLaVA-VL/LLaVA-NeXT/blob/main/scripts/train): Start training models on your single-image/multi-image/video data.
54
+
55
+ - [2024/07/16] 🔥 **LLaVA-NeXT-Video** has been upgraded. The new 32B model achieves the best open-source performance on several video benchmarks, including [Video-MME](https://video-mme.github.io/home_page.html#leaderboard). Please refer to [this page](docs/LLaVA-NeXT-Video_0716.md) for details, refer to [llava_next-video_demo](https://huggingface.co/spaces/WildVision/vision-arena) for demo.
56
+
57
+
58
+ - [2024/06/23] 🔥 **LLaVA-NeXT-Interleave** is released. We utilize image-text interleaved format to unify multi-image, video, and 3D tasks in one LLM and achieve **SoTA** performance on a wide range of benchmarks. Check out [paper](https://arxiv.org/pdf/2407.07895), [blog](https://llava-vl.github.io/blog/2024-06-16-llava-next-interleave/), and [checkpoints](https://huggingface.co/collections/lmms-lab/llava-next-interleave-66763c55c411b340b35873d1) to see new capabilities and improved performance! We have released 0.5b, 7b, and 7b-dpo models.
59
+ * An all-round LLM for multi-image, video, and 3D with strong performance \[[demo](https://huggingface.co/spaces/lmms-lab/LLaVA-NeXT-Interleave-Demo)\]
60
+ * Construct interleave training data [**M4-Instruct**](https://huggingface.co/datasets/lmms-lab/M4-Instruct-Data)
61
+ * Construct multi-image benchmark [**LLaVA-Interleave Bench**](https://huggingface.co/datasets/lmms-lab/LLaVA-NeXT-Interleave-Bench)
62
+
63
+
64
+ - [2024/05/25] 🔥 Wondering "[What Else Influences Visual Instruction Tuning Beyond Data?](https://llava-vl.github.io/blog/2024-05-25-llava-next-ablations/)" Our new [blog](https://llava-vl.github.io/blog/2024-05-25-llava-next-ablations/) summarizes empirical explorations to ablate the various design choices in improving LMMs except instruct data itself. Meanwhile, open-source the recapioned high-quality data using LLaVA-NeXT-34B on [[COCO]](https://huggingface.co/datasets/lmms-lab/LLaVA-ReCap-118K) [[LCS]](https://huggingface.co/datasets/lmms-lab/LLaVA-ReCap-558K) [[CC3M]](https://huggingface.co/datasets/lmms-lab/LLaVA-ReCap-CC3M).
65
+ * Architectures (LMM & Vision Encoder)
66
+ * Visual Representations (Resolution & # Tokens)
67
+ * Training Strategies (High-quality data & Trainable modules)
68
+
69
+ - [2024/05/10] 🔥 **LLaVA-NeXT** (Stronger) models are released, with support of stronger LMM inlcuding LLama-3 (8B) and Qwen-1.5 (72B/110B) Check out [[blog](https://llava-vl.github.io/blog/2024-05-10-llava-next-stronger-llms/)] and [[checkpoints](https://huggingface.co/lmms-lab)] to see improved performance!
70
+ - [2024/05/10] 🔥 **LLaVA-NeXT** (Video) is released. The image-only-trained LLaVA-NeXT model is surprisingly strong on video tasks with zero-shot modality transfer. DPO training with AI feedback on videos can yield significant improvement. [[Blog](https://llava-vl.github.io/blog/2024-04-30-llava-next-video/)], [[checkpoints](https://huggingface.co/collections/lmms-lab/llava-next-video-661e86f5e8dabc3ff793c944)] and [[sglang](https://github.com/sgl-project/sglang)]
71
+ - [2024/01/30] 🔥 **LLaVA-NeXT** is out! With additional scaling to LLaVA-1.5, LLaVA-NeXT-34B outperforms Gemini Pro on some benchmarks. It can now process 4x more pixels and perform more tasks/applications than before. Check out the [blog post](https://llava-vl.github.io/blog/2024-01-30-llava-next/), and explore the [demo](https://llava.hliu.cc/)! Models are available in [Model Zoo](https://github.com/haotian-liu/LLaVA/blob/main/docs/MODEL_ZOO.md). Training/eval data and scripts coming soon.
72
+ <details>
73
+ <summary>More</summary>
74
+
75
+ - [2024/03/10] 🔥 Releasing **LMMs-Eval**, a highly efficient evaluation pipeline we used when developing LLaVA-NeXT. It supports the evaluation of LMMs on dozens of public datasets and allows new dataset onboarding, making the dev of new LMMs much faster. [[Blog](https://lmms-lab.github.io/lmms-eval-blog/lmms-eval-0.1/)] [[Codebase](https://github.com/EvolvingLMMs-Lab/lmms-eval)]
76
+
77
+ - [2023/11/10] [LLaVA-Plus](https://llava-vl.github.io/llava-plus/) is released: Learning to Use Tools for Creating Multimodal Agents, with LLaVA-Plus (LLaVA that Plug and Learn to Use Skills). [[Project Page](https://llava-vl.github.io/llava-plus/)] [[Demo](https://llavaplus.ngrok.io/)] [[Code](https://github.com/LLaVA-VL/LLaVA-Plus-Codebase)] [[Paper](https://arxiv.org/abs/2311.05437)]
78
+ - [2023/11/02] [LLaVA-Interactive](https://llava-vl.github.io/llava-interactive/) is released: Experience the future of human-AI multimodal interaction with an all-in-one demo for Image Chat, Segmentation, Generation and Editing. [[Project Page](https://llava-vl.github.io/llava-interactive/)] [[Demo](https://llavainteractive.ngrok.io/)] [[Code](https://github.com/LLaVA-VL/LLaVA-Interactive-Demo)] [[Paper](https://arxiv.org/abs/2311.00571)]
79
+ - [2023/10/26] 🔥 LLaVA-1.5 with LoRA achieves comparable performance as full-model finetuning, with a reduced GPU RAM requirement ([ckpts](https://github.com/haotian-liu/LLaVA/blob/main/docs/MODEL_ZOO.md#llava-v15), [script](https://github.com/haotian-liu/LLaVA#train)). We also provide a [doc](https://github.com/haotian-liu/LLaVA/blob/main/docs/Finetune_Custom_Data.md) on how to finetune LLaVA-1.5 on your own dataset with LoRA.
80
+ - [2023/10/12] Check out the Korean LLaVA (Ko-LLaVA), created by ETRI, who has generously supported our research! [[🤗 Demo](https://huggingface.co/spaces/etri-vilab/Ko-LLaVA)]
81
+ - [2023/10/05] 🔥 LLaVA-1.5 is out! Achieving SoTA on 11 benchmarks, with just simple modifications to the original LLaVA, utilizes all public data, completes training in ~1 day on a single 8-A100 node, and surpasses methods like Qwen-VL-Chat that use billion-scale data. Check out the [technical report](https://arxiv.org/abs/2310.03744), and explore the [demo](https://llava.hliu.cc/)! Models are available in [Model Zoo](https://github.com/haotian-liu/LLaVA/blob/main/docs/MODEL_ZOO.md). The training data and scripts of LLaVA-1.5 are released [here](https://github.com/haotian-liu/LLaVA#train), and evaluation scripts are released [here](https://github.com/haotian-liu/LLaVA/blob/main/docs/Evaluation.md)!
82
+ - [2023/09/26] LLaVA is improved with reinforcement learning from human feedback (RLHF) to improve fact grounding and reduce hallucination. Check out the new SFT and RLHF checkpoints at project [[LLavA-RLHF]](https://llava-rlhf.github.io/)
83
+ - [2023/09/22] [LLaVA](https://arxiv.org/abs/2304.08485) is accepted by NeurIPS 2023 as **oral presentation**, and [LLaVA-Med](https://arxiv.org/abs/2306.00890) is accepted by NeurIPS 2023 Datasets and Benchmarks Track as **spotlight presentation**.
84
+ - [2023/11/06] Support **Intel** dGPU and CPU platforms. [More details here.](https://github.com/haotian-liu/LLaVA/tree/intel/docs/intel)
85
+ - [2023/10/12] LLaVA is now supported in [llama.cpp](https://github.com/ggerganov/llama.cpp/pull/3436) with 4-bit / 5-bit quantization support!
86
+ - [2023/10/11] The training data and scripts of LLaVA-1.5 are released [here](https://github.com/haotian-liu/LLaVA#train), and evaluation scripts are released [here](https://github.com/haotian-liu/LLaVA/blob/main/docs/Evaluation.md)!
87
+ - [2023/10/10] [Roboflow Deep Dive](https://blog.roboflow.com/first-impressions-with-llava-1-5/): First Impressions with LLaVA-1.5.
88
+ - [2023/09/20] We summarize our empirical study of training 33B and 65B LLaVA models in a [note](https://arxiv.org/abs/2309.09958). Further, if you are interested in the comprehensive review, evolution and trend of multimodal foundation models, please check out our recent survey paper [``Multimodal Foundation Models: From Specialists to General-Purpose Assistants''.](https://arxiv.org/abs/2309.10020)
89
+ <p align="center">
90
+ <img src="https://github.com/Computer-Vision-in-the-Wild/CVinW_Readings/blob/main/images/mfm_evolution.jpeg?raw=true" width=50%/>
91
+ </p>
92
+
93
+ - [2023/07/19] 🔥 We release a major upgrade, including support for LLaMA-2, LoRA training, 4-/8-bit inference, higher resolution (336x336), and a lot more. We release [LLaVA Bench](https://github.com/haotian-liu/LLaVA/blob/main/docs/LLaVA_Bench.md) for benchmarking open-ended visual chat with results from Bard and Bing-Chat. We also support and verify training with RTX 3090 and RTX A6000. Check out [LLaVA-from-LLaMA-2](https://github.com/haotian-liu/LLaVA/blob/main/docs/LLaVA_from_LLaMA2.md), and our [model zoo](https://github.com/haotian-liu/LLaVA/blob/main/docs/MODEL_ZOO.md)!
94
+ - [2023/06/26] [CVPR 2023 Tutorial](https://vlp-tutorial.github.io/) on **Large Multimodal Models: Towards Building and Surpassing Multimodal GPT-4**! Please check out [[Slides](https://datarelease.blob.core.windows.net/tutorial/vision_foundation_models_2023/slides/Chunyuan_cvpr2023_tutorial_lmm.pdf)] [[Notes](https://arxiv.org/abs/2306.14895)] [[YouTube](https://youtu.be/mkI7EPD1vp8)] [[Bilibli](https://www.bilibili.com/video/BV1Ng4y1T7v3/)].
95
+ - [2023/06/11] We released the preview for the most requested feature: DeepSpeed and LoRA support! Please see documentations [here](./docs/LoRA.md).
96
+ - [2023/06/01] We released **LLaVA-Med: Large Language and Vision Assistant for Biomedicine**, a step towards building biomedical domain large language and vision models with GPT-4 level capabilities. Checkout the [paper](https://arxiv.org/abs/2306.00890) and [page](https://github.com/microsoft/LLaVA-Med).
97
+ - [2023/05/06] We are releasing [LLaVA-Lighting-MPT-7B-preview](https://huggingface.co/liuhaotian/LLaVA-Lightning-MPT-7B-preview), based on MPT-7B-Chat! See [here](#LLaVA-MPT-7b) for more details.
98
+ - [2023/05/02] 🔥 We are releasing LLaVA-Lighting! Train a lite, multimodal GPT-4 with just $40 in 3 hours! See [here](#train-llava-lightning) for more details.
99
+ - [2023/04/27] Thanks to the community effort, LLaVA-13B with 4-bit quantization allows you to run on a GPU with as few as 12GB VRAM! Try it out [here](https://github.com/oobabooga/text-generation-webui/tree/main/extensions/llava).
100
+ - [2023/04/17] 🔥 We released **LLaVA: Large Language and Vision Assistant**. We propose visual instruction tuning, towards building large language and vision models with GPT-4 level capabilities. Checkout the [paper](https://arxiv.org/abs/2304.08485) and [demo](https://llava.hliu.cc/).
101
+
102
+ </details>
103
+
104
+ <!-- <a href="https://llava.hliu.cc/"><img src="assets/demo.gif" width="70%"></a> -->
105
+
106
+ **Usage and License Notices**: 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](https://openai.com/policies/terms-of-use) for the dataset and the specific licenses for base language models for checkpoints trained using the dataset (e.g. [Llama-1/2 community license](https://ai.meta.com/llama/license/) for LLaMA-2 and Vicuna-v1.5, [Tongyi Qianwen RESEARCH LICENSE AGREEMENT](https://huggingface.co/Qwen/Qwen1.5-0.5B-Chat/blob/main/LICENSE) and [Llama-3 Research License](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.
107
+
108
+ ## Models & Scripts
109
+
110
+ ### Installation
111
+
112
+ #### 1. **Clone this repository and navigate to the LLaVA folder:**
113
+ ```bash
114
+ git clone https://github.com/LLaVA-VL/LLaVA-NeXT
115
+ cd LLaVA-NeXT
116
+ ```
117
+
118
+ #### 2. **Install the inference package:**
119
+ ```bash
120
+ conda create -n llava python=3.10 -y
121
+ conda activate llava
122
+ pip install --upgrade pip # Enable PEP 660 support.
123
+ pip install -e ".[train]"
124
+ ```
125
+
126
+ ### Project Navigation
127
+ Please checkout the following page for more inference & evaluation details.
128
+
129
+ #### - **LLaVA-OneVision: Easy Task Transfer**
130
+ - [LLaVA-OneVision](https://github.com/LLaVA-VL/LLaVA-NeXT/blob/main/docs/LLaVA_OneVision.md): for demo inference. The evaluation code is in [lmms-eval](https://github.com/EvolvingLMMs-Lab/lmms-eval).
131
+
132
+ #### - **LLaVA-NeXT: Stronger LLMs Supercharge Multimodal Capabilities in the Wild**
133
+ - [LLaVA-NeXT-Image](./docs/LLaVA-NeXT.md): for image demo inference and evaluation of stronger LMMs using [lmms-eval](https://github.com/EvolvingLMMs-Lab/lmms-eval).
134
+
135
+
136
+ #### - LLaVA-NeXT: A Strong Zero-shot Video Understanding Model
137
+ - [LLaVA-NeXT-Video](./docs/LLaVA-NeXT-Video.md): for video inference and evaluation scripts. We recommend to use [LMMs-video](https://lmms-lab.github.io/posts/lmms-eval-0.2/) for evaluation.
138
+
139
+ #### - LLaVA-NeXT: Tackling Multi-image, Video, and 3D in Large Multimodal Models
140
+ - [LLaVA-NeXT-Interleave](./docs/LLaVA-NeXT-Interleave.md): for multi-image demo and evaluation scripts.
141
+
142
+ ## SGLang for SpeedUp Inference and Deployment
143
+
144
+ We use [SGLang](https://github.com/sgl-project/sglang) to speed up inference and deployment of LLaVA-NeXT. You could make LLaVA-NeXT as a backend API service with SGLang.
145
+
146
+ **Prepare Environment**:
147
+ Following the instruction in the [sglang](https://github.com/sgl-project/sglang?tab=readme-ov-file#install)
148
+
149
+ ### LLaVA-NeXT/OneVision
150
+
151
+ Checkout the HTTP Post/Get and SRT usage at [sglang/examples/runtime/llava_onevision](https://github.com/sgl-project/sglang/tree/main/examples/runtime/llava_onevision)
152
+
153
+ ### LLaVA-NeXT (Video)
154
+
155
+ **Launch and Run on (K) Nodes**:
156
+ - Go to sglang project
157
+ ```
158
+ cd PATH_TO/sglang
159
+ ```
160
+ - First node:
161
+ ```sh
162
+ bash examples/usage/llava_video/srt_example_llava_v.sh K 0 YOUR_VIDEO_PATH YOUR_MODEL_PATH FRAMES_PER_VIDEO
163
+ (e.g. bash examples/usage/llava_video/srt_example_llava_v.sh K 0 examples/usage/llava_video/videos/Q98Z4OTh8RwmDonc.mp4 lmms-lab/LLaVA-NeXT-Video-7B-DPO 16)
164
+ ```
165
+ - Second node:
166
+ ```sh
167
+ bash examples/usage/llava_video/srt_example_llava_v.sh K 1 YOUR_VIDEO_PATH YOUR_MODEL_PATH FRAMES_PER_VIDEO
168
+ ```
169
+ - The K node:
170
+ ```sh
171
+ bash examples/usage/llava_video/srt_example_llava_v.sh K K-1 YOUR_VIDEO_PATH YOUR_MODEL_PATH FRAMES_PER_VIDEO
172
+ ```
173
+
174
+
175
+ ## Citation
176
+
177
+ If you find it useful for your research and applications, please cite related papers/blogs using this BibTeX:
178
+ ```bibtex
179
+ @article{li2024llava,
180
+ title={LLaVA-NeXT-Interleave: Tackling Multi-image, Video, and 3D in Large Multimodal Models},
181
+ author={Li, Feng and Zhang, Renrui and Zhang, Hao and Zhang, Yuanhan and Li, Bo and Li, Wei and Ma, Zejun and Li, Chunyuan},
182
+ journal={arXiv preprint arXiv:2407.07895},
183
+ year={2024}
184
+ }
185
+
186
+ @misc{li2024llavanext-ablations,
187
+ title={LLaVA-NeXT: What Else Influences Visual Instruction Tuning Beyond Data?},
188
+ url={https://llava-vl.github.io/blog/2024-05-25-llava-next-ablations/},
189
+ author={Li, Bo and Zhang, Hao and Zhang, Kaichen and Guo, Dong and Zhang, Yuanhan and Zhang, Renrui and Li, Feng and Liu, Ziwei and Li, Chunyuan},
190
+ month={May},
191
+ year={2024}
192
+ }
193
+
194
+ @misc{li2024llavanext-strong,
195
+ title={LLaVA-NeXT: Stronger LLMs Supercharge Multimodal Capabilities in the Wild},
196
+ url={https://llava-vl.github.io/blog/2024-05-10-llava-next-stronger-llms/},
197
+ author={Li, Bo and Zhang, Kaichen and Zhang, Hao and Guo, Dong and Zhang, Renrui and Li, Feng and Zhang, Yuanhan and Liu, Ziwei and Li, Chunyuan},
198
+ month={May},
199
+ year={2024}
200
+ }
201
+
202
+ @misc{zhang2024llavanext-video,
203
+ title={LLaVA-NeXT: A Strong Zero-shot Video Understanding Model},
204
+ url={https://llava-vl.github.io/blog/2024-04-30-llava-next-video/},
205
+ author={Zhang, Yuanhan and Li, Bo and Liu, haotian and Lee, Yong jae and Gui, Liangke and Fu, Di and Feng, Jiashi and Liu, Ziwei and Li, Chunyuan},
206
+ month={April},
207
+ year={2024}
208
+ }
209
+
210
+ @misc{liu2024llavanext,
211
+ title={LLaVA-NeXT: Improved reasoning, OCR, and world knowledge},
212
+ url={https://llava-vl.github.io/blog/2024-01-30-llava-next/},
213
+ author={Liu, Haotian and Li, Chunyuan and Li, Yuheng and Li, Bo and Zhang, Yuanhan and Shen, Sheng and Lee, Yong Jae},
214
+ month={January},
215
+ year={2024}
216
+ }
217
+
218
+ @misc{liu2023improvedllava,
219
+ title={Improved Baselines with Visual Instruction Tuning},
220
+ author={Liu, Haotian and Li, Chunyuan and Li, Yuheng and Lee, Yong Jae},
221
+ publisher={arXiv:2310.03744},
222
+ year={2023},
223
+ }
224
+
225
+ @misc{liu2023llava,
226
+ title={Visual Instruction Tuning},
227
+ author={Liu, Haotian and Li, Chunyuan and Wu, Qingyang and Lee, Yong Jae},
228
+ publisher={NeurIPS},
229
+ year={2023},
230
+ }
231
+ ```
232
+
233
+ ## Acknowledgement
234
+
235
+ - [Vicuna](https://github.com/lm-sys/FastChat): the codebase we built upon, and our base model Vicuna-13B that has the amazing language capabilities!
236
+ - The LLaVA-NeXT project is currently maintained by the team along with our contributors (listed alphabetically by the first names): [Bo Li](https://brianboli.com/), [Dong Guo](https://www.linkedin.com/in/dongguoset/), [Feng Li](https://scholar.google.com/citations?hl=zh-CN&user=ybRe9GcAAAAJ&view_op=list_works&sortby=pubdate), [Hao Zhang](https://scholar.google.com/citations?user=B8hPxMQAAAAJ&hl=en), [Kaichen Zhang](https://www.linkedin.com/in/kaichen-zhang-014b17219/?originalSubdomain=sg), [Renrui Zhang](https://zrrskywalker.github.io/), [Yuanhan Zhang](https://zhangyuanhan-ai.github.io/), led by [Chunyuan Li](https://chunyuan.li/) and with the guidance and help from [Haotian Liu](https://hliu.cc/).
237
+ - The `lmms-eval` framework and its core contributors, including Peiyuan Zhang, Fanyi Pu, Joshua Adrian Cahyono, and Kairui Hu, for their support on the evaluation side.
238
+
239
+ ## Related Projects
240
+
241
+ - [Instruction Tuning with GPT-4](https://github.com/Instruction-Tuning-with-GPT-4/GPT-4-LLM)
242
+ - [LLaVA-Med: Training a Large Language-and-Vision Assistant for Biomedicine in One Day](https://github.com/microsoft/LLaVA-Med)
243
+ - [Otter: In-Context Multi-Modal Instruction Tuning](https://github.com/Luodian/Otter)
244
+
245
+ For future project ideas, please check out:
246
+ - [SEEM: Segment Everything Everywhere All at Once](https://github.com/UX-Decoder/Segment-Everything-Everywhere-All-At-Once)
247
+ - [Grounded-Segment-Anything](https://github.com/IDEA-Research/Grounded-Segment-Anything) to detect, segment, and generate anything by marrying [Grounding DINO](https://github.com/IDEA-Research/GroundingDINO) and [Segment-Anything](https://github.com/facebookresearch/segment-anything).
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/cog.yaml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Configuration for Cog ⚙️
2
+ # Reference: https://github.com/replicate/cog/blob/main/docs/yaml.md
3
+
4
+ build:
5
+ gpu: true
6
+
7
+ python_version: "3.11"
8
+
9
+ python_packages:
10
+ - "torch==2.0.1"
11
+ - "accelerate==0.21.0"
12
+ - "bitsandbytes==0.41.0"
13
+ - "deepspeed==0.9.5"
14
+ - "einops-exts==0.0.4"
15
+ - "einops==0.6.1"
16
+ - "gradio==3.35.2"
17
+ - "gradio_client==0.2.9"
18
+ - "httpx==0.24.0"
19
+ - "markdown2==2.4.10"
20
+ - "numpy==1.26.0"
21
+ - "peft==0.4.0"
22
+ - "scikit-learn==1.2.2"
23
+ - "sentencepiece==0.1.99"
24
+ - "shortuuid==1.0.11"
25
+ - "timm==0.6.13"
26
+ - "tokenizers==0.13.3"
27
+ - "torch==2.0.1"
28
+ - "torchvision==0.15.2"
29
+ - "transformers==4.31.0"
30
+ - "wandb==0.15.12"
31
+ - "wavedrom==2.0.3.post3"
32
+ - "Pygments==2.16.1"
33
+ run:
34
+ - curl -o /usr/local/bin/pget -L "https://github.com/replicate/pget/releases/download/v0.0.3/pget" && chmod +x /usr/local/bin/pget
35
+
36
+ # predict.py defines how predictions are run on your model
37
+ predict: "predict.py:Predictor"
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/predict.py ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+
3
+ from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN
4
+ from llava.conversation import conv_templates, SeparatorStyle
5
+ from llava.model.builder import load_pretrained_model
6
+ from llava.utils import disable_torch_init
7
+ from llava.mm_utils import tokenizer_image_token, KeywordsStoppingCriteria
8
+ from transformers.generation.streamers import TextIteratorStreamer
9
+
10
+ from PIL import Image
11
+
12
+ import requests
13
+ from io import BytesIO
14
+
15
+ from cog import BasePredictor, Input, Path, ConcatenateIterator
16
+ import time
17
+ import subprocess
18
+ from threading import Thread
19
+
20
+ import os
21
+ os.environ["HUGGINGFACE_HUB_CACHE"] = os.getcwd() + "/weights"
22
+
23
+ # url for the weights mirror
24
+ REPLICATE_WEIGHTS_URL = "https://weights.replicate.delivery/default"
25
+ # files to download from the weights mirrors
26
+ weights = [
27
+ {
28
+ "dest": "liuhaotian/llava-v1.5-13b",
29
+ # git commit hash from huggingface
30
+ "src": "llava-v1.5-13b/006818fc465ebda4c003c0998674d9141d8d95f8",
31
+ "files": [
32
+ "config.json",
33
+ "generation_config.json",
34
+ "pytorch_model-00001-of-00003.bin",
35
+ "pytorch_model-00002-of-00003.bin",
36
+ "pytorch_model-00003-of-00003.bin",
37
+ "pytorch_model.bin.index.json",
38
+ "special_tokens_map.json",
39
+ "tokenizer.model",
40
+ "tokenizer_config.json",
41
+ ],
42
+ },
43
+ {
44
+ "dest": "openai/clip-vit-large-patch14-336",
45
+ "src": "clip-vit-large-patch14-336/ce19dc912ca5cd21c8a653c79e251e808ccabcd1",
46
+ "files": ["config.json", "preprocessor_config.json", "pytorch_model.bin"],
47
+ },
48
+ ]
49
+
50
+
51
+ def download_json(url: str, dest: Path):
52
+ res = requests.get(url, allow_redirects=True)
53
+ if res.status_code == 200 and res.content:
54
+ with dest.open("wb") as f:
55
+ f.write(res.content)
56
+ else:
57
+ print(f"Failed to download {url}. Status code: {res.status_code}")
58
+
59
+ def download_weights(baseurl: str, basedest: str, files: list[str]):
60
+ basedest = Path(basedest)
61
+ start = time.time()
62
+ print("downloading to: ", basedest)
63
+ basedest.mkdir(parents=True, exist_ok=True)
64
+ for f in files:
65
+ dest = basedest / f
66
+ url = os.path.join(REPLICATE_WEIGHTS_URL, baseurl, f)
67
+ if not dest.exists():
68
+ print("downloading url: ", url)
69
+ if dest.suffix == ".json":
70
+ download_json(url, dest)
71
+ else:
72
+ subprocess.check_call(["pget", url, str(dest)], close_fds=False)
73
+ print("downloading took: ", time.time() - start)
74
+
75
+ class Predictor(BasePredictor):
76
+ def setup(self) -> None:
77
+ """Load the model into memory to make running multiple predictions efficient"""
78
+ for weight in weights:
79
+ download_weights(weight["src"], weight["dest"], weight["files"])
80
+ disable_torch_init()
81
+ self.tokenizer, self.model, self.image_processor, self.context_len = load_pretrained_model("liuhaotian/llava-v1.5-13b", model_name="llava-v1.5-13b", model_base=None, load_8bit=False, load_4bit=False)
82
+
83
+ def predict(
84
+ self,
85
+ image: Path = Input(description="Input image"),
86
+ prompt: str = Input(description="Prompt to use for text generation"),
87
+ top_p: float = Input(description="When decoding text, samples from the top p percentage of most likely tokens; lower to ignore less likely tokens", ge=0.0, le=1.0, default=1.0),
88
+ temperature: float = Input(description="Adjusts randomness of outputs, greater than 1 is random and 0 is deterministic", default=0.2, ge=0.0),
89
+ max_tokens: int = Input(description="Maximum number of tokens to generate. A word is generally 2-3 tokens", default=1024, ge=0),
90
+ ) -> ConcatenateIterator[str]:
91
+ """Run a single prediction on the model"""
92
+
93
+ conv_mode = "llava_v1"
94
+ conv = conv_templates[conv_mode].copy()
95
+
96
+ image_data = load_image(str(image))
97
+ image_tensor = self.image_processor.preprocess(image_data, return_tensors="pt")["pixel_values"].half().cuda()
98
+
99
+ # loop start
100
+
101
+ # just one turn, always prepend image token
102
+ inp = DEFAULT_IMAGE_TOKEN + "\n" + prompt
103
+ conv.append_message(conv.roles[0], inp)
104
+
105
+ conv.append_message(conv.roles[1], None)
106
+ prompt = conv.get_prompt()
107
+
108
+ input_ids = tokenizer_image_token(prompt, self.tokenizer, IMAGE_TOKEN_INDEX, return_tensors="pt").unsqueeze(0).cuda()
109
+ stop_str = conv.sep if conv.sep_style != SeparatorStyle.TWO else conv.sep2
110
+ keywords = [stop_str]
111
+ stopping_criteria = KeywordsStoppingCriteria(keywords, self.tokenizer, input_ids)
112
+ streamer = TextIteratorStreamer(self.tokenizer, skip_prompt=True, timeout=20.0)
113
+
114
+ with torch.inference_mode():
115
+ thread = Thread(
116
+ target=self.model.generate,
117
+ kwargs=dict(inputs=input_ids, images=image_tensor, do_sample=True, temperature=temperature, top_p=top_p, max_new_tokens=max_tokens, streamer=streamer, use_cache=True, stopping_criteria=[stopping_criteria]),
118
+ )
119
+ thread.start()
120
+ # workaround: second-to-last token is always " "
121
+ # but we want to keep it if it's not the second-to-last token
122
+ prepend_space = False
123
+ for new_text in streamer:
124
+ if new_text == " ":
125
+ prepend_space = True
126
+ continue
127
+ if new_text.endswith(stop_str):
128
+ new_text = new_text[: -len(stop_str)].strip()
129
+ prepend_space = False
130
+ elif prepend_space:
131
+ new_text = " " + new_text
132
+ prepend_space = False
133
+ if len(new_text):
134
+ yield new_text
135
+ if prepend_space:
136
+ yield " "
137
+ thread.join()
138
+
139
+
140
+ def load_image(image_file):
141
+ if image_file.startswith("http") or image_file.startswith("https"):
142
+ response = requests.get(image_file)
143
+ image = Image.open(BytesIO(response.content)).convert("RGB")
144
+ else:
145
+ image = Image.open(image_file).convert("RGB")
146
+ return image
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/pyproject.toml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [tool.black]
2
+ line-length = 240
3
+
4
+ [build-system]
5
+ requires = ["setuptools>=61.0"]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project]
9
+ name = "llava"
10
+ version = "1.7.0.dev0"
11
+ description = "LLaVA OneVision: The Next Generation of LLaVA with Better Image and Video Understanding Capabilities"
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: Apache Software License",
17
+ ]
18
+
19
+ [project.optional-dependencies]
20
+ standalone = [
21
+ "shortuuid",
22
+ "httpx==0.24.0",
23
+ "einops",
24
+ "ftfy",
25
+ ]
26
+
27
+
28
+ train = [
29
+ "llava[standalone]",
30
+ "numpy==1.26.1",
31
+ "open_clip_torch",
32
+ "fastapi",
33
+ "markdown2[all]",
34
+ "numpy",
35
+ "requests",
36
+ "sentencepiece",
37
+ "torch==2.1.2",
38
+ "torchvision==0.16.2",
39
+ "uvicorn",
40
+ "wandb",
41
+ "deepspeed==0.14.4",
42
+ "peft==0.4.0",
43
+ "accelerate>=0.29.1",
44
+ "tokenizers~=0.15.2",
45
+ "transformers@git+https://github.com/huggingface/transformers.git@1c39974a4c4036fd641bc1191cc32799f85715a4",
46
+ "bitsandbytes==0.41.0",
47
+ "scikit-learn==1.2.2",
48
+ "sentencepiece~=0.1.99",
49
+ "einops==0.6.1",
50
+ "einops-exts==0.0.4",
51
+ "gradio_client==0.2.9",
52
+ "urllib3<=2.0.0",
53
+ "datasets==2.16.1",
54
+ "pydantic==1.10.8",
55
+ "timm",
56
+ "hf_transfer",
57
+ "opencv-python",
58
+ "av",
59
+ "decord",
60
+ "tyro",
61
+ "scipy",
62
+ ]
63
+
64
+ [project.urls]
65
+ "Homepage" = "https://llava-vl.github.io"
66
+ "Bug Tracker" = "https://github.com/haotian-liu/LLaVA/issues"
67
+
68
+ [tool.setuptools.packages.find]
69
+ include = ["llava*", "trl*"]
70
+ exclude = [
71
+ "assets*",
72
+ "benchmark*",
73
+ "docs",
74
+ "dist*",
75
+ "playground*",
76
+ "scripts*",
77
+ "tests*",
78
+ "checkpoints*",
79
+ "project_checkpoints*",
80
+ "debug_checkpoints*",
81
+ "mlx_configs*",
82
+ "wandb*",
83
+ "notebooks*",
84
+ ]
85
+
86
+ [tool.wheel]
87
+ exclude = [
88
+ "assets*",
89
+ "benchmark*",
90
+ "docs",
91
+ "dist*",
92
+ "playground*",
93
+ "scripts*",
94
+ "tests*",
95
+ "checkpoints*",
96
+ "project_checkpoints*",
97
+ "debug_checkpoints*",
98
+ "mlx_configs*",
99
+ "wandb*",
100
+ "notebooks*",
101
+ ]
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/requirements.txt ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Babel==2.14.0
2
+ DataProperty==1.0.1
3
+ Deprecated==1.2.14
4
+ GitPython==3.1.43
5
+ Jinja2==3.1.3
6
+ Levenshtein==0.25.1
7
+ MarkupSafe==2.1.5
8
+ PyJWT==2.8.0
9
+ PyYAML==6.0.1
10
+ Pygments==2.17.2
11
+ QtPy==2.4.1
12
+ Send2Trash==1.8.3
13
+ absl-py==2.1.0
14
+ accelerate==0.29.3
15
+ aiofiles==22.1.0
16
+ aiohttp==3.9.5
17
+ aiosignal==1.3.1
18
+ aiosqlite==0.20.0
19
+ altair==5.3.0
20
+ anyio==4.3.0
21
+ appdirs==1.4.4
22
+ argon2-cffi-bindings==21.2.0
23
+ argon2-cffi==23.1.0
24
+ arrow==1.3.0
25
+ asttokens==2.4.1
26
+ async-timeout==4.0.3
27
+ attrs==23.1.0
28
+ beautifulsoup4==4.12.3
29
+ bidict==0.23.1
30
+ bitsandbytes==0.41.0
31
+ black==24.1.0
32
+ bleach==6.1.0
33
+ byted-remote-ikernel==0.4.8
34
+ byted-torch-monitor==0.0.1
35
+ byted-wandb==0.13.72
36
+ bytedance-context==0.7.1
37
+ bytedance-metrics==0.5.1
38
+ bytedance.modelhub==0.0.64
39
+ bytedance.servicediscovery==0.1.2
40
+ bytedbackgrounds==0.0.6
41
+ byteddatabus==1.0.6
42
+ byteddps==0.1.2
43
+ bytedenv==0.6.2
44
+ bytedlogger==0.15.1
45
+ bytedmemfd==0.2
46
+ bytedmetrics==0.10.2
47
+ bytedpymongo==2.0.5
48
+ bytedrh2==1.18.7a2
49
+ bytedservicediscovery==0.17.4
50
+ bytedtcc==1.4.2
51
+ bytedtos==1.1.16
52
+ bytedtrace==0.3.0
53
+ bytedztijwthelper==0.0.22
54
+ bytedztispiffe==0.0.11
55
+ certifi==2024.2.2
56
+ cffi==1.16.0
57
+ cfgv==3.4.0
58
+ chardet==5.2.0
59
+ charset-normalizer==3.3.2
60
+ click==8.1.7
61
+ colorama==0.4.6
62
+ comm==0.2.2
63
+ contourpy==1.2.1
64
+ crcmod==1.7
65
+ cryptography==38.0.4
66
+ cycler==0.12.1
67
+ datasets==2.16.1
68
+ debugpy==1.8.1
69
+ decorator==5.1.1
70
+ decord==0.6.0
71
+ deepspeed==0.12.2
72
+ defusedxml==0.7.1
73
+ dill==0.3.7
74
+ distlib==0.3.8
75
+ distro==1.9.0
76
+ dnspython==2.6.1
77
+ docker-pycreds==0.4.0
78
+ docstring_parser==0.16
79
+ einops-exts==0.0.4
80
+ einops==0.6.1
81
+ entrypoints==0.4
82
+ et-xmlfile==1.1.0
83
+ eval_type_backport==0.2.0
84
+ evaluate==0.4.1
85
+ exceptiongroup==1.2.1
86
+ executing==2.0.1
87
+ fastapi==0.110.2
88
+ fastjsonschema==2.19.1
89
+ ffmpy==0.3.2
90
+ filelock==3.13.4
91
+ flash-attn==2.5.7
92
+ fonttools==4.51.0
93
+ fqdn==1.5.1
94
+ frozenlist==1.4.1
95
+ fsspec==2023.10.0
96
+ ftfy==6.2.0
97
+ gitdb==4.0.11
98
+ gradio==3.35.2
99
+ gradio_client==0.2.9
100
+ grpcio==1.62.2
101
+ h11==0.14.0
102
+ hf_transfer==0.1.6
103
+ hjson==3.1.0
104
+ httpcore==0.17.3
105
+ httpx==0.24.0
106
+ huggingface-hub==0.22.2
107
+ identify==2.5.36
108
+ idna==3.7
109
+ importlib_metadata==7.1.0
110
+ importlib_resources==6.4.0
111
+ iniconfig==2.0.0
112
+ ipaddress==1.0.23
113
+ ipykernel==6.29.4
114
+ ipython-genutils==0.2.0
115
+ ipython==8.18.1
116
+ ipywidgets==8.1.2
117
+ isoduration==20.11.0
118
+ jedi==0.19.1
119
+ joblib==1.4.0
120
+ json5==0.9.25
121
+ jsonlines==4.0.0
122
+ jsonpointer==2.4
123
+ jsonschema-specifications==2023.12.1
124
+ jsonschema==4.21.1
125
+ jupyter-client==7.0.0
126
+ jupyter-console==6.6.3
127
+ jupyter-events==0.10.0
128
+ jupyter-ydoc==0.2.5
129
+ jupyter==1.0.0
130
+ jupyter_core==5.7.2
131
+ jupyter_server==2.14.0
132
+ jupyter_server_fileid==0.9.2
133
+ jupyter_server_terminals==0.5.3
134
+ jupyter_server_ydoc==0.8.0
135
+ jupyterlab==3.6.4
136
+ jupyterlab_pygments==0.3.0
137
+ jupyterlab_server==2.27.1
138
+ jupyterlab_widgets==3.0.10
139
+ kiwisolver==1.4.5
140
+ linkify-it-py==2.0.3
141
+ llava==1.7.0.dev0
142
+ llava==1.7.0.dev0
143
+ lmms_eval==0.1.1
144
+ lxml==5.2.1
145
+ markdown-it-py==2.2.0
146
+ markdown2==2.4.13
147
+ matplotlib-inline==0.1.7
148
+ matplotlib==3.8.4
149
+ mbstrdecoder==1.1.3
150
+ mdit-py-plugins==0.3.3
151
+ mdurl==0.1.2
152
+ mistune==3.0.2
153
+ mpmath==1.3.0
154
+ msgpack==1.0.8
155
+ multidict==6.0.5
156
+ multiprocess==0.70.15
157
+ mypy-extensions==1.0.0
158
+ nbclassic==1.0.0
159
+ nbclient==0.10.0
160
+ nbconvert==7.16.3
161
+ nbformat==5.10.4
162
+ nest-asyncio==1.6.0
163
+ networkx==3.2.1
164
+ ninja==1.11.1.1
165
+ nltk==3.8.1
166
+ nodeenv==1.8.0
167
+ notebook==6.5.6
168
+ notebook_shim==0.2.4
169
+ numexpr==2.10.0
170
+ numpy==1.26.4
171
+ nvidia-cublas-cu12==12.1.3.1
172
+ nvidia-cuda-cupti-cu12==12.1.105
173
+ nvidia-cuda-nvrtc-cu12==12.1.105
174
+ nvidia-cuda-runtime-cu12==12.1.105
175
+ nvidia-cudnn-cu12==8.9.2.26
176
+ nvidia-cufft-cu12==11.0.2.54
177
+ nvidia-curand-cu12==10.3.2.106
178
+ nvidia-cusolver-cu12==11.4.5.107
179
+ nvidia-cusparse-cu12==12.1.0.106
180
+ nvidia-nccl-cu12==2.18.1
181
+ nvidia-nvjitlink-cu12==12.4.127
182
+ nvidia-nvtx-cu12==12.1.105
183
+ open-clip-torch==2.24.0
184
+ openai==1.23.6
185
+ opencv-python-headless==4.9.0.80
186
+ openpyxl==3.1.2
187
+ orjson==3.10.1
188
+ overrides==7.7.0
189
+ packaging==24.0
190
+ pandas==2.2.2
191
+ pandocfilters==1.5.1
192
+ parso==0.8.4
193
+ pathlib2==2.3.7.post1
194
+ pathspec==0.12.1
195
+ pathtools==0.1.2
196
+ pathvalidate==3.2.0
197
+ peft==0.4.0
198
+ pexpect==4.8.0
199
+ pillow==10.3.0
200
+ pip==23.3.1
201
+ pip==24.0
202
+ platformdirs==4.2.1
203
+ pluggy==1.5.0
204
+ ply==3.11
205
+ portalocker==2.8.2
206
+ pre-commit==3.7.0
207
+ prometheus_client==0.20.0
208
+ promise==2.3
209
+ prompt-toolkit==3.0.43
210
+ protobuf==3.20.3
211
+ psutil==5.9.8
212
+ ptyprocess==0.7.0
213
+ pure-eval==0.2.2
214
+ py-cpuinfo==9.0.0
215
+ py-spy==0.3.14
216
+ py==1.11.0
217
+ pyOpenSSL==22.1.0
218
+ pyarrow-hotfix==0.6
219
+ pyarrow==16.0.0
220
+ pybind11==2.12.0
221
+ pycocoevalcap==1.2
222
+ pycocotools==2.0.7
223
+ pycparser==2.22
224
+ pycryptodomex==3.20.0
225
+ pydantic==1.10.8
226
+ pydub==0.25.1
227
+ pynvml==11.5.0
228
+ pyparsing==3.1.2
229
+ pytablewriter==1.2.0
230
+ pytest==6.2.5
231
+ python-consul==1.1.0
232
+ python-dateutil==2.9.0.post0
233
+ python-engineio==4.9.0
234
+ python-etcd==0.4.5
235
+ python-json-logger==2.0.7
236
+ python-multipart==0.0.9
237
+ python-socketio==5.11.2
238
+ pytz==2024.1
239
+ pyzmq==24.0.1
240
+ qtconsole==5.5.1
241
+ rapidfuzz==3.8.1
242
+ referencing==0.35.0
243
+ regex==2024.4.16
244
+ requests==2.31.0
245
+ responses==0.18.0
246
+ rfc3339-validator==0.1.4
247
+ rfc3986-validator==0.1.1
248
+ rich==13.7.1
249
+ rouge-score==0.1.2
250
+ rpds-py==0.18.0
251
+ sacrebleu==2.4.2
252
+ safetensors==0.4.3
253
+ schedule==1.2.1
254
+ scikit-learn==1.2.2
255
+ scipy==1.13.0
256
+ semantic-version==2.10.0
257
+ sentencepiece==0.1.99
258
+ sentry-sdk==2.0.0
259
+ setproctitle==1.3.3
260
+ setuptools==68.2.2
261
+ shortuuid==1.0.13
262
+ shtab==1.7.1
263
+ simple-websocket==1.0.0
264
+ six==1.16.0
265
+ smmap==5.0.1
266
+ sniffio==1.3.1
267
+ soupsieve==2.5
268
+ sqlitedict==2.1.0
269
+ stack-data==0.6.3
270
+ starlette==0.37.2
271
+ svgwrite==1.4.3
272
+ sympy==1.12
273
+ tabledata==1.3.3
274
+ tabulate==0.9.0
275
+ tcolorpy==0.1.4
276
+ tenacity==8.2.3
277
+ terminado==0.18.1
278
+ threadpoolctl==3.4.0
279
+ thriftpy2==0.4.20
280
+ tiktoken==0.6.0
281
+ timm==0.9.16
282
+ tinycss2==1.3.0
283
+ tokenizers==0.15.2
284
+ toml==0.10.2
285
+ tomli==2.0.1
286
+ toolz==0.12.1
287
+ torch==2.1.2
288
+ torchvision==0.16.2
289
+ tornado==6.4
290
+ tox==3.28.0
291
+ tqdm-multiprocess==0.0.11
292
+ tqdm==4.66.2
293
+ traitlets==5.14.3
294
+ transformers-stream-generator==0.0.5
295
+ transformers==4.40.0.dev0
296
+ triton==2.1.0
297
+ typepy==1.3.2
298
+ types-python-dateutil==2.9.0.20240316
299
+ typing_extensions==4.11.0
300
+ tyro==0.8.3
301
+ tzdata==2024.1
302
+ uc-micro-py==1.0.3
303
+ uri-template==1.3.0
304
+ urllib3==2.2.1
305
+ uvicorn==0.29.0
306
+ virtualenv==20.26.0
307
+ wandb==0.16.5
308
+ watchdog==4.0.0
309
+ wavedrom==2.0.3.post3
310
+ wcwidth==0.2.13
311
+ webcolors==1.13
312
+ webencodings==0.5.1
313
+ websocket-client==1.8.0
314
+ websockets==12.0
315
+ wheel==0.41.2
316
+ widgetsnbextension==4.0.10
317
+ wrapt==1.16.0
318
+ wsproto==1.2.0
319
+ xxhash==3.4.1
320
+ y-py==0.6.2
321
+ yarl==1.9.4
322
+ ypy-websocket==0.8.4
323
+ zipp==3.18.1
324
+ zstandard==0.22.0
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/qwen.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import AutoModelForCausalLM, AutoTokenizer
2
+ import torch
3
+
4
+ device = "cuda" # the device to load the model onto
5
+
6
+ model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen1.5-MoE-A2.7B-Chat", torch_dtype=torch.bfloat16, device_map="auto")
7
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen1.5-MoE-A2.7B-Chat")
8
+
9
+ prompt = "Give me a short introduction to large language model."
10
+ messages = [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": prompt}]
11
+ text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
12
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
13
+
14
+ generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=512)
15
+ generated_ids = [output_ids[len(input_ids) :] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)]
16
+
17
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
18
+
19
+ print(response)
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/summarize_data.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ from tqdm import tqdm
4
+
5
+ with open("/mnt/bn/vl-research/workspace/boli01/zzzprojects/LLaVA/playground/data/llava_v1_5_mix665k.json") as f:
6
+ llava_v1_5_mix665k = json.load(f) # 665298
7
+
8
+ with open("/mnt/bn/vl-research/workspace/boli01/zzzprojects/LLaVA/playground/data/llava_instruct_150k.json") as f:
9
+ llava_instruct_150k = json.load(f) # 157712
10
+
11
+ # Create sets of "id" fields
12
+ mix665k_ids = set()
13
+ for item in llava_v1_5_mix665k:
14
+ all_conv = ""
15
+ for cur_conversation in item["conversations"]:
16
+ all_conv += cur_conversation["value"]
17
+ mix665k_ids.add(f'{item["id"]}_{all_conv}')
18
+
19
+ instruct_150k_ids = set()
20
+ for item in llava_instruct_150k:
21
+ all_conv = ""
22
+ for cur_conversation in item["conversations"]:
23
+ all_conv += cur_conversation["value"]
24
+ instruct_150k_ids.add(f'{item["id"]}_{all_conv}')
25
+
26
+ share_gpt_ids = set()
27
+ for item in llava_v1_5_mix665k:
28
+ if "image" not in item:
29
+ all_conv = ""
30
+ for cur_conversation in item["conversations"]:
31
+ all_conv += cur_conversation["value"]
32
+ share_gpt_ids.add(f'{item["id"]}_{all_conv}') # 40688
33
+
34
+ # Get "id" fields that are in mix665k but not in instruct_150k and share_gpt
35
+ new_ids = mix665k_ids - instruct_150k_ids - share_gpt_ids # 466898
36
+
37
+ # Get "id" fields that are in mix665k but not in share_gpt
38
+ # new_ids = mix665k_ids - share_gpt_ids #624610
39
+
40
+ # import pdb; pdb.set_trace()
41
+
42
+ # Filter mix665k data based on new_ids
43
+ new_data = []
44
+ for item in llava_v1_5_mix665k:
45
+ all_conv = ""
46
+ for cur_conversation in item["conversations"]:
47
+ all_conv += cur_conversation["value"]
48
+ if f'{item["id"]}_{all_conv}' in new_ids:
49
+ new_data.append(item)
50
+
51
+ import pdb
52
+
53
+ pdb.set_trace()
54
+
55
+ with open("/mnt/bn/vl-research/workspace/boli01/zzzprojects/LLaVA/playground/data/mixtral_instruct_135K_of_158K_V1.5.json") as f:
56
+ new_mixtral_instruct = json.load(f)
57
+
58
+ # mixtral_instruct_50K_of_80K_V1.json@
59
+
60
+ # print(len(new_data))
61
+ # for _ in new_mixtral_instruct:
62
+ # # import pdb; pdb.set_trace()
63
+ # if "coco" not in _["image"]:
64
+ # _["image"] = f"coco/train2017/{_['image']}"
65
+ # new_data.append(_)
66
+
67
+ # print(len(instruct_150k_ids))
68
+ print(len(new_data))
69
+
70
+ # for _ in tqdm(new_data):
71
+ # if "image" in _:
72
+ # if "000000442654" in _["image"]:
73
+ # all_conv = ""
74
+ # for cur_conversation in _["conversations"]:
75
+ # all_conv += cur_conversation["value"]
76
+ # # if not os.path.exists(f'/mnt/bn/vl-research/workspace/boli01/data/playground/data/{_["image"]}'):
77
+ # import pdb; pdb.set_trace()
78
+
79
+ # Write new_data to a new JSON file
80
+ with open("/mnt/bn/vl-research/workspace/boli01/zzzprojects/LLaVA/playground/data/llava_v1_5_mix665k_minus_llava_instruct_150k_minus_sharegpt_plus_mixtral_instruct_135K_of_158K_V1.5.json", "w") as f:
81
+ json.dump(new_data, f)
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/train/finetune_si.sh ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export OMP_NUM_THREADS=8
2
+ export NCCL_IB_DISABLE=0
3
+ export NCCL_IB_GID_INDEX=3
4
+ export NCCL_SOCKET_IFNAME=eth0
5
+ export NCCL_DEBUG=INFO
6
+
7
+ LLM_VERSION="Qwen/Qwen2-7B-Instruct"
8
+ # for 7b model we recommend bs=1, accum=2, 16 nodes, 128 gpus, lr=1e-5, warmup=0.03
9
+ # for 72b model we recommend bs=1, accum=1, 32 nodes, 256 gpus, lr=1e-5, warmup=0.03
10
+ LLM_VERSION_CLEAN="${LLM_VERSION//\//_}"
11
+ VISION_MODEL_VERSION="google/siglip-so400m-patch14-384"
12
+ VISION_MODEL_VERSION_CLEAN="${VISION_MODEL_VERSION//\//_}"
13
+
14
+ ############### Pretrain ################
15
+
16
+ BASE_RUN_NAME="llavanext-google_siglip-so400m-patch14-384-Qwen_Qwen2-7B-Instruct-mlp2x_gelu-pretrain_blip558k_plain"
17
+ echo "BASE_RUN_NAME: ${BASE_RUN_NAME}"
18
+
19
+ ############### Finetune ################
20
+
21
+ # Stage 2
22
+ PROMPT_VERSION="qwen_1_5"
23
+ RUN_NAME="llava-onevision-${VISION_MODEL_VERSION_CLEAN}-${LLM_VERSION_CLEAN}-si_stage_am9"
24
+ PREV_STAGE_CHECKPOINT="/mnt/bn/vl-research/checkpoints/onevision/xxxxxxxxxxxxxxxx" # replace it with your last checkpoint training from mid stage
25
+ echo "PREV_STAGE_CHECKPOINT: ${PREV_STAGE_CHECKPOINT}"
26
+ echo "MID_RUN_NAME: ${RUN_NAME}"
27
+
28
+ ACCELERATE_CPU_AFFINITY=1 torchrun --nproc_per_node="${NUM_GPUS}" --nnodes="${NNODES}" --node_rank="${RANK}" --master_addr="${ADDR}" --master_port="${PORT}" \
29
+ llava/train/train_mem.py \
30
+ --deepspeed scripts/zero3.json \
31
+ --model_name_or_path $PREV_STAGE_CHECKPOINT \
32
+ --version $PROMPT_VERSION \
33
+ --data_path /mnt/bn/vl-research/workspace/boli01/projects/LLaVA_Next/scripts/i18n/scale_llms/next_3p2m_single_image.yaml \
34
+ --image_folder /mnt/bn/vl-research/data/llava_data \
35
+ --video_folder /mnt/bn/vl-research/data/llava_video \
36
+ --mm_tunable_parts="mm_vision_tower,mm_mlp_adapter,mm_language_model" \
37
+ --mm_vision_tower_lr=2e-6 \
38
+ --vision_tower ${VISION_MODEL_VERSION} \
39
+ --mm_projector_type mlp2x_gelu \
40
+ --mm_vision_select_layer -2 \
41
+ --mm_use_im_start_end False \
42
+ --mm_use_im_patch_token False \
43
+ --group_by_modality_length True \
44
+ --image_aspect_ratio anyres_max_9 \
45
+ --image_grid_pinpoints "(1x1),...,(6x6)" \
46
+ --mm_patch_merge_type spatial_unpad \
47
+ --bf16 True \
48
+ --run_name $RUN_NAME \
49
+ --output_dir /mnt/bn/vl-research/checkpoints/onevision/$RUN_NAME \
50
+ --num_train_epochs 1 \
51
+ --per_device_train_batch_size 1 \
52
+ --per_device_eval_batch_size 4 \
53
+ --gradient_accumulation_steps 2 \
54
+ --evaluation_strategy "no" \
55
+ --save_strategy "steps" \
56
+ --save_steps 1000 \
57
+ --save_total_limit 1 \
58
+ --learning_rate 1e-5 \
59
+ --weight_decay 0. \
60
+ --warmup_ratio 0.03 \
61
+ --lr_scheduler_type "cosine" \
62
+ --logging_steps 1 \
63
+ --tf32 True \
64
+ --model_max_length 32768 \
65
+ --gradient_checkpointing True \
66
+ --dataloader_num_workers 4 \
67
+ --lazy_preprocess True \
68
+ --report_to wandb \
69
+ --torch_compile True \
70
+ --torch_compile_backend "inductor" \
71
+ --dataloader_drop_last True \
72
+ --frames_upbound 32
73
+ exit 0;
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/train/single_image.yaml ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ datasets:
2
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/llava_next_fit_mix_filtered_text_wild_738590.json # released in lmms-lab/LLaVA-NeXT-Data
3
+ sampling_strategy: "all"
4
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/llava_wild_4v_39k.json # not released
5
+ sampling_strategy: "all"
6
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/llava_wild_4v_12k.json # not released
7
+ sampling_strategy: "all"
8
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/llavar_gpt4_20k.json
9
+ sampling_strategy: "all"
10
+ # - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/sroie_data_33626.json
11
+ # sampling_strategy: "first:10%"
12
+ # - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/orand_car_a_train_2009.json
13
+ # sampling_strategy: "all"
14
+ # - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/orand_car_b_train_3000.json
15
+ # sampling_strategy: "all"
16
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/mavis_math_metagen_87358.json
17
+ sampling_strategy: "all"
18
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/mavis_math_rule_geo_100000.json
19
+ sampling_strategy: "all"
20
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/chrome_writting_train_8835.json
21
+ sampling_strategy: "all"
22
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/k12_printing_train_256646.json
23
+ sampling_strategy: "first:1%"
24
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/iiit5k_annotations_2000.json
25
+ sampling_strategy: "all"
26
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/hme100k_train_clean_74502.json
27
+ sampling_strategy: "first:10%"
28
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/ai2d_azuregpt_detailed_understanding_4874.json
29
+ sampling_strategy: "all"
30
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/infographic_vqa_4404.json
31
+ sampling_strategy: "all"
32
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/infographic_azuregpt4v_1992.json
33
+ sampling_strategy: "all"
34
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/lrv_chart_1787.json
35
+ sampling_strategy: "all"
36
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/lrv_normal_gpt4v_filtered_10500.json
37
+ sampling_strategy: "all"
38
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/scienceqa_nona_context_19218.json
39
+ sampling_strategy: "first:5%"
40
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/allava_instruct_vflan4v_20000.json
41
+ sampling_strategy: "all"
42
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/allava_instruct_laion4v_50000.json
43
+ sampling_strategy: "all"
44
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/textocr_gpt4v_train_converted_25114.json
45
+ sampling_strategy: "all"
46
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/ai2d_train_internvl_single_12413.json
47
+ sampling_strategy: "all"
48
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/textcaps_train_21952.json
49
+ sampling_strategy: "all"
50
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/ureader_new/ureader_qa_sft.json
51
+ sampling_strategy: "all"
52
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/ureader_new/ureader_cap_sft.json
53
+ sampling_strategy: "all"
54
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/ureader_new/ureader_ie_sft.json
55
+ sampling_strategy: "all"
56
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/ureader_new/ureader_kg_sft.json
57
+ sampling_strategy: "all"
58
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/vision_flan_filtered_186070.json
59
+ sampling_strategy: "all"
60
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/mathqa_29837.json
61
+ sampling_strategy: "all"
62
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/geo3k_2101.json
63
+ sampling_strategy: "all"
64
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/geo170k_qa_converted_67833.json
65
+ sampling_strategy: "all"
66
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/geo170k_align_converted_60252.json
67
+ sampling_strategy: "all"
68
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/sharegpt4v-coco-50k.json
69
+ sampling_strategy: "all"
70
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/sharegpt4v-knowledge-2k.json
71
+ sampling_strategy: "all"
72
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/sharegpt4v-llava-30k.json
73
+ sampling_strategy: "all"
74
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/sharegpt4v-sam-20k.json
75
+ sampling_strategy: "all"
76
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_CLEVR-Math_5290.json
77
+ sampling_strategy: "all"
78
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_FigureQA_17597.json
79
+ sampling_strategy: "first:5%"
80
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_Geometry3K_9734.json
81
+ sampling_strategy: "all"
82
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_GeoQA+_17172.json
83
+ sampling_strategy: "all"
84
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_GEOS_508.json
85
+ sampling_strategy: "all"
86
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_IconQA_22599.json
87
+ sampling_strategy: "first:5%"
88
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_MapQA_5235.json
89
+ sampling_strategy: "all"
90
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_PMC-VQA_35958.json
91
+ sampling_strategy: "first:5%"
92
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_Super-CLEVR_8652.json
93
+ sampling_strategy: "all"
94
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_TabMWP_22462.json
95
+ sampling_strategy: "all"
96
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_TQA_10181.json
97
+ sampling_strategy: "all"
98
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_UniGeo_11959.json
99
+ sampling_strategy: "all"
100
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_VizWiz_6614.json
101
+ sampling_strategy: "all"
102
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_VQA-AS_5907.json
103
+ sampling_strategy: "all"
104
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/MathV360K_VQA-RAD_2130.json
105
+ sampling_strategy: "all"
106
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/Evol-Instruct-GPT4-Turbo-143000.json
107
+ sampling_strategy: "first:30%"
108
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/magpie_pro_qwen2_72b_st_300000_sp_token_fltd_299992.json
109
+ sampling_strategy: "first:50%"
110
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/magpie_pro_l3_80b_st_300000.json
111
+ sampling_strategy: "first:50%"
112
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/magpie_pro_l3_80b_mt_300000_sp_token_fltd_299998.json
113
+ sampling_strategy: "first:50%"
114
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/image_textualization_dataset_filtered.json
115
+ sampling_strategy: "all"
116
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/cambrian_filtered_gpt4vo_sp_token_fltd_max10k.json
117
+ sampling_strategy: "all"
118
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/real_vision_flan/sharegpt4o_dataset.jsonl
119
+ sampling_strategy: "all"
120
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/ai2d_llava_format_2434.json
121
+ sampling_strategy: "all"
122
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/aokvqa_16539_llava_format.json
123
+ sampling_strategy: "all"
124
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/chart2text_26961.json
125
+ sampling_strategy: "all"
126
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/chartqa_18265_llava_format.json
127
+ sampling_strategy: "all"
128
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/clevr_70000_llava_format.json
129
+ sampling_strategy: "first:1%"
130
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/diagram_image_to_text_300.json
131
+ sampling_strategy: "all"
132
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/dvqa_200000_llava_format.json
133
+ sampling_strategy: "first:1%"
134
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/figureqa_100000_llava_format.json
135
+ sampling_strategy: "first:1%"
136
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/geomverse_9303.json
137
+ sampling_strategy: "all"
138
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/hateful_memes_8500_llava_format.json
139
+ sampling_strategy: "all"
140
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/hitab_2500_llava_format.json
141
+ sampling_strategy: "all"
142
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/iam_5663.json
143
+ sampling_strategy: "all"
144
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/raven_42000.json
145
+ sampling_strategy: "first:5%"
146
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/iconqa_llava_format_27307.json
147
+ sampling_strategy: "first:5%"
148
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/infographic_vqa_2118_llava_format.json
149
+ sampling_strategy: "all"
150
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/intergps_1280_llava_format.json
151
+ sampling_strategy: "all"
152
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/mapqa_37417_llava_format.json
153
+ sampling_strategy: "all"
154
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/multihiertt_7619.json
155
+ sampling_strategy: "all"
156
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/rendered_text_10000.json
157
+ sampling_strategy: "all"
158
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/robut_sqa_8514.json
159
+ sampling_strategy: "all"
160
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/robut_wikisql_74989.json
161
+ sampling_strategy: "all"
162
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/robut_wtq_38246_llava_format.json
163
+ sampling_strategy: "all"
164
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/screen2words_15730.json
165
+ sampling_strategy: "all"
166
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/scienceqa_llava_format_4976.json
167
+ sampling_strategy: "all"
168
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/tabmwp_22722.json
169
+ sampling_strategy: "all"
170
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/tallyqa_98680_llava_format.json
171
+ sampling_strategy: "first:10%"
172
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/st_vqa_17247_llava_format.json
173
+ sampling_strategy: "all"
174
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/tqa_llava_format_27307.json
175
+ sampling_strategy: "first:5%"
176
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/visual7w_llava_format_14366.json
177
+ sampling_strategy: "all"
178
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/visualmrc_3027.json
179
+ sampling_strategy: "all"
180
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/vqarad_313_llava_format.json
181
+ sampling_strategy: "all"
182
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/vsr_2157_llava_format.json
183
+ sampling_strategy: "all"
184
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/vistext_9969.json
185
+ sampling_strategy: "all"
186
+ - json_path: /mnt/bn/vl-research/data/llava_instruct/cauldron/websight_10000.json
187
+ sampling_strategy: "all"
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero2.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fp16": {
3
+ "enabled": "auto",
4
+ "loss_scale": 0,
5
+ "loss_scale_window": 1000,
6
+ "initial_scale_power": 16,
7
+ "hysteresis": 2,
8
+ "min_loss_scale": 1
9
+ },
10
+ "bf16": {
11
+ "enabled": "auto"
12
+ },
13
+ "optimizer": {
14
+ "type": "AdamW",
15
+ "params": {
16
+ "lr": "auto",
17
+ "betas": "auto",
18
+ "eps": "auto",
19
+ "weight_decay": "auto"
20
+ }
21
+ },
22
+ "zero_optimization": {
23
+ "stage": 2,
24
+ "offload_optimizer": {
25
+ "device": "none",
26
+ "pin_memory": true
27
+ },
28
+ "allgather_partitions": true,
29
+ "allgather_bucket_size": 2e8,
30
+ "overlap_comm": false,
31
+ "reduce_scatter": true,
32
+ "reduce_bucket_size": 2e8,
33
+ "contiguous_gradients": true
34
+ },
35
+ "gradient_accumulation_steps": "auto",
36
+ "gradient_clipping": "auto",
37
+ "steps_per_print": 100,
38
+ "train_batch_size": "auto",
39
+ "train_micro_batch_size_per_gpu": "auto",
40
+ "wall_clock_breakdown": false
41
+ }
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero2_fused_adamw.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fp16": {
3
+ "enabled": "auto",
4
+ "loss_scale": 0,
5
+ "loss_scale_window": 1000,
6
+ "initial_scale_power": 16,
7
+ "hysteresis": 2,
8
+ "min_loss_scale": 1
9
+ },
10
+ "bf16": {
11
+ "enabled": "auto"
12
+ },
13
+ "optimizer": {
14
+ "type": "AdamW",
15
+ "params": {
16
+ "lr": "auto",
17
+ "betas": "auto",
18
+ "eps": "auto",
19
+ "weight_decay": "auto"
20
+ }
21
+ },
22
+ "zero_optimization": {
23
+ "stage": 2,
24
+ "offload_optimizer": {
25
+ "device": "none",
26
+ "pin_memory": true
27
+ },
28
+ "allgather_partitions": true,
29
+ "allgather_bucket_size": 2e8,
30
+ "overlap_comm": true,
31
+ "reduce_scatter": true,
32
+ "reduce_bucket_size": 2e8,
33
+ "contiguous_gradients": true
34
+ },
35
+ "gradient_accumulation_steps": "auto",
36
+ "gradient_clipping": "auto",
37
+ "steps_per_print": 100,
38
+ "train_batch_size": "auto",
39
+ "train_micro_batch_size_per_gpu": "auto",
40
+ "wall_clock_breakdown": false
41
+ }
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero2_offload.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fp16": {
3
+ "enabled": "auto",
4
+ "loss_scale": 0,
5
+ "loss_scale_window": 1000,
6
+ "initial_scale_power": 16,
7
+ "hysteresis": 2,
8
+ "min_loss_scale": 1
9
+ },
10
+ "bf16": {
11
+ "enabled": "auto"
12
+ },
13
+ "train_micro_batch_size_per_gpu": "auto",
14
+ "train_batch_size": "auto",
15
+ "gradient_accumulation_steps": "auto",
16
+ "zero_optimization": {
17
+ "stage": 2,
18
+ "offload_optimizer": {
19
+ "device": "cpu",
20
+ "pin_memory": true
21
+ },
22
+ "offload_param": {
23
+ "device": "cpu",
24
+ "pin_memory": true
25
+ },
26
+ "overlap_comm": true,
27
+ "contiguous_gradients": true,
28
+ "sub_group_size": 1e9,
29
+ "reduce_bucket_size": "auto"
30
+ }
31
+ }
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero3.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fp16": {
3
+ "enabled": "auto",
4
+ "loss_scale": 0,
5
+ "loss_scale_window": 1000,
6
+ "initial_scale_power": 16,
7
+ "hysteresis": 2,
8
+ "min_loss_scale": 1
9
+ },
10
+ "bf16": {
11
+ "enabled": "auto"
12
+ },
13
+
14
+ "zero_optimization": {
15
+ "stage": 3,
16
+ "offload_optimizer": {
17
+ "device": "none",
18
+ "pin_memory": true
19
+ },
20
+ "offload_param": {
21
+ "device": "none",
22
+ "pin_memory": true
23
+ },
24
+ "overlap_comm": true,
25
+ "contiguous_gradients": true,
26
+ "sub_group_size": 1e9,
27
+ "reduce_bucket_size": "auto",
28
+ "stage3_prefetch_bucket_size": "auto",
29
+ "stage3_param_persistence_threshold": "auto",
30
+ "stage3_max_live_parameters": 1e9,
31
+ "stage3_max_reuse_distance": 1e9,
32
+ "stage3_gather_16bit_weights_on_model_save": true
33
+ },
34
+
35
+ "gradient_accumulation_steps": "auto",
36
+ "gradient_clipping": "auto",
37
+ "steps_per_print": 100,
38
+ "train_batch_size": "auto",
39
+ "train_micro_batch_size_per_gpu": "auto",
40
+ "wall_clock_breakdown": false
41
+ }
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero3_offload.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fp16": {
3
+ "enabled": "auto",
4
+ "loss_scale": 0,
5
+ "loss_scale_window": 1000,
6
+ "initial_scale_power": 16,
7
+ "hysteresis": 2,
8
+ "min_loss_scale": 1
9
+ },
10
+ "bf16": {
11
+ "enabled": "auto"
12
+ },
13
+ "optimizer": {
14
+ "type": "AdamW",
15
+ "params": {
16
+ "lr": "auto",
17
+ "betas": "auto",
18
+ "eps": "auto",
19
+ "weight_decay": "auto"
20
+ }
21
+ },
22
+ "zero_optimization": {
23
+ "stage": 3,
24
+ "offload_optimizer": {
25
+ "device": "cpu",
26
+ "pin_memory": true
27
+ },
28
+ "offload_param": {
29
+ "device": "cpu",
30
+ "pin_memory": true
31
+ },
32
+ "overlap_comm": true,
33
+ "contiguous_gradients": true,
34
+ "sub_group_size": 1e9,
35
+ "reduce_bucket_size": "auto",
36
+ "stage3_prefetch_bucket_size": "auto",
37
+ "stage3_param_persistence_threshold": "auto",
38
+ "stage3_max_live_parameters": 1e9,
39
+ "stage3_max_reuse_distance": 1e9,
40
+ "gather_16bit_weights_on_model_save": true
41
+ },
42
+ "gradient_accumulation_steps": "auto",
43
+ "gradient_clipping": "auto",
44
+ "train_batch_size": "auto",
45
+ "train_micro_batch_size_per_gpu": "auto",
46
+ "steps_per_print": 1e5,
47
+ "wall_clock_breakdown": false
48
+ }
之前的代码版本/这一版注意力有问题/MedEvalKit/LLaVA-NeXT/scripts/zero3pp.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fp16": {
3
+ "enabled": "auto",
4
+ "loss_scale": 0,
5
+ "loss_scale_window": 1000,
6
+ "initial_scale_power": 16,
7
+ "hysteresis": 2,
8
+ "min_loss_scale": 1
9
+ },
10
+ "bf16": {
11
+ "enabled": "auto"
12
+ },
13
+ "optimizer": {
14
+ "type": "AdamW",
15
+ "params": {
16
+ "lr": "auto",
17
+ "betas": "auto",
18
+ "eps": "auto",
19
+ "weight_decay": "auto"
20
+ }
21
+ },
22
+
23
+ "zero_optimization": {
24
+ "stage": 3,
25
+ "offload_optimizer": {
26
+ "device": "none",
27
+ "pin_memory": true
28
+ },
29
+ "offload_param": {
30
+ "device": "none",
31
+ "pin_memory": true
32
+ },
33
+ "overlap_comm": true,
34
+ "contiguous_gradients": true,
35
+ "zero_quantized_weights": true,
36
+ "zero_hpz_partition_size": 16,
37
+ "zero_quantized_gradients": true,
38
+ "sub_group_size": 1e9,
39
+ "reduce_bucket_size": "auto",
40
+ "stage3_prefetch_bucket_size": "auto",
41
+ "stage3_param_persistence_threshold": "auto",
42
+ "stage3_max_live_parameters": 1e9,
43
+ "stage3_max_reuse_distance": 1e9,
44
+ "stage3_gather_16bit_weights_on_model_save": true
45
+ },
46
+
47
+ "gradient_accumulation_steps": "auto",
48
+ "gradient_clipping": "auto",
49
+ "steps_per_print": 100,
50
+ "train_batch_size": "auto",
51
+ "train_micro_batch_size_per_gpu": "auto",
52
+ "wall_clock_breakdown": false
53
+ }