tlvtech commited on
Commit
dc71c15
1 Parent(s): 66df0aa

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +6 -0
  2. .gitignore +58 -0
  3. LICENSE +201 -0
  4. README.md +341 -8
  5. assets/cat_and_chicken.mp4 +3 -0
  6. assets/logo.png +0 -0
  7. assets/pipeline.png +3 -0
  8. assets/sora.mp4 +3 -0
  9. assets/sora.png +3 -0
  10. aws/README.md +54 -0
  11. aws/THIRD_PARTY_LICENSES +1468 -0
  12. aws/install +155 -0
  13. awscliv2.zip +3 -0
  14. pyproject.toml +41 -0
  15. requirements.txt +40 -0
  16. scripts/custom/finetune.sh +74 -0
  17. scripts/custom/finetune_lora.sh +75 -0
  18. scripts/custom/finetune_qlora.sh +75 -0
  19. scripts/eval/eval_video_cap_msvc.sh +67 -0
  20. scripts/eval/eval_video_mcqa_egoschema.sh +41 -0
  21. scripts/eval/eval_video_mcqa_mvbench.sh +46 -0
  22. scripts/eval/eval_video_mcqa_perception_test_mcqa.sh +45 -0
  23. scripts/eval/eval_video_mcqa_videomme.sh +84 -0
  24. scripts/eval/eval_video_oqa_activitynet.sh +54 -0
  25. scripts/eval/eval_video_oqa_msvd.sh +54 -0
  26. scripts/eval/eval_video_oqa_vcgpt_1_correctness.sh +58 -0
  27. scripts/eval/eval_video_oqa_vcgpt_2_detail.sh +58 -0
  28. scripts/eval/eval_video_oqa_vcgpt_3_context.sh +58 -0
  29. scripts/eval/eval_video_oqa_vcgpt_4_temporal.sh +54 -0
  30. scripts/eval/eval_video_oqa_vcgpt_5_consistency.sh +54 -0
  31. scripts/siglip/finetune_gemma2.sh +75 -0
  32. scripts/siglip/finetune_mistral.sh +75 -0
  33. scripts/siglip/finetune_phi3.sh +75 -0
  34. scripts/siglip/finetune_qwen2.sh +75 -0
  35. scripts/siglip/pretrain_gemma2.sh +75 -0
  36. scripts/siglip/pretrain_mistral.sh +75 -0
  37. scripts/siglip/pretrain_phi3.sh +75 -0
  38. scripts/siglip/pretrain_qwen2.sh +75 -0
  39. scripts/vllava/finetune.sh +74 -0
  40. scripts/vllava/pretrain.sh +74 -0
  41. serve_videos/2024-10-01/01047cc89321a1a8f88442647d59a97e_3.jpg +0 -0
  42. serve_videos/2024-10-01/0151039fcf5ae698df36e30ec84f3681_1.jpg +0 -0
  43. serve_videos/2024-10-01/27da6fcd831e07c89bccca0d446c1ebf_6.jpg +0 -0
  44. serve_videos/2024-10-01/36ffc3ede02479166140d3754af82726_0.jpg +0 -0
  45. serve_videos/2024-10-01/41d66b0e6c66a2ec825c217aeccfd58d_2.jpg +0 -0
  46. serve_videos/2024-10-01/6435a100db222d818f142b8a21fe9ea8_7.jpg +0 -0
  47. serve_videos/2024-10-01/7896f6bd33f5afed1ff70acfd8dc657a_0.jpg +0 -0
  48. serve_videos/2024-10-01/8b308fd1f62b37b8b990cc87c996b14d_6.jpg +0 -0
  49. serve_videos/2024-10-01/a2fe273d47b18c9c50cb85a2ce553572_4.jpg +0 -0
  50. serve_videos/2024-10-01/ab3a343f94cf27fb1cda3d09b93beea3_3.jpg +0 -0
.gitattributes CHANGED
@@ -33,3 +33,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/cat_and_chicken.mp4 filter=lfs diff=lfs merge=lfs -text
37
+ assets/pipeline.png filter=lfs diff=lfs merge=lfs -text
38
+ assets/sora.mp4 filter=lfs diff=lfs merge=lfs -text
39
+ assets/sora.png filter=lfs diff=lfs merge=lfs -text
40
+ videollama2/serve/examples/1034346401.mp4 filter=lfs diff=lfs merge=lfs -text
41
+ videollama2/serve/examples/sample_demo_1.mp4 filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python
2
+ __pycache__
3
+ *.pyc
4
+ *.egg-info
5
+ dist
6
+
7
+ # Log
8
+ *.log
9
+ *.log.*
10
+ *.json
11
+ *.jsonl
12
+ log_dir*/
13
+ temp*/
14
+
15
+ # Data
16
+ !**/alpaca-data-conversation.json
17
+
18
+ # Editor
19
+ .idea
20
+ *.swp
21
+
22
+ # Other
23
+ .DS_Store
24
+ 3rd_parties
25
+
26
+ # jupyter
27
+ .ipynb_checkpoints
28
+ *.ipynb
29
+
30
+ # DevContainer
31
+ !.devcontainer/*
32
+
33
+ # Demo
34
+ serve_images/
35
+ temp/
36
+
37
+ # data folder
38
+ data/
39
+ dataset/
40
+ datasets/
41
+
42
+ # training folder
43
+ wandb
44
+ ckpts*
45
+ output
46
+ output/
47
+ checkpoints
48
+ checkpoints/
49
+ work_dirs*/
50
+
51
+ # evaluation folder
52
+ /eval
53
+ /eval*
54
+
55
+ # pretrained weights
56
+ pretrained/
57
+ publish_models/
58
+ public_models/
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.
README.md CHANGED
@@ -1,12 +1,345 @@
1
  ---
2
- title: Verblaze
3
- emoji: 🌖
4
- colorFrom: red
5
- colorTo: yellow
6
  sdk: gradio
7
- sdk_version: 4.44.0
8
- app_file: app.py
9
- pinned: false
10
  ---
 
 
 
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: verblaze
3
+ app_file: videollama2/serve/gradio_web_server.py
 
 
4
  sdk: gradio
5
+ sdk_version: 3.50.0
 
 
6
  ---
7
+ <p align="center">
8
+ <img src="https://github.com/DAMO-NLP-SG/VideoLLaMA2/blob/e7bc34e0e9a96d77947a75b54399d9f96ccf209d/assets/logo.png" width="150" style="margin-bottom: 0.2;"/>
9
+ <p>
10
 
11
+ <h3 align="center"><a href="https://arxiv.org/abs/2406.07476" style="color:#9C276A">
12
+ VideoLLaMA 2: Advancing Spatial-Temporal Modeling and Audio Understanding in Video-LLMs</a></h3>
13
+ <h5 align="center"> If our project helps you, please give us a star ⭐ on GitHub to support us. 🙏🙏 </h2>
14
+
15
+ <h5 align="center">
16
+
17
+ [![hf_space](https://img.shields.io/badge/🤗-Demo-9C276A.svg)](https://huggingface.co/spaces/lixin4ever/VideoLLaMA2)
18
+ [![hf_checkpoint](https://img.shields.io/badge/🤗-Checkpoints-9C276A.svg)](https://huggingface.co/collections/DAMO-NLP-SG/videollama-2-6669b6b6f0493188305c87ed)
19
+ [![hf_data](https://img.shields.io/badge/🤗-MSVC-9C276A.svg)](https://huggingface.co/datasets/DAMO-NLP-SG/Multi-Source-Video-Captioning)
20
+ [![arXiv](https://img.shields.io/badge/Arxiv-2406.07476-AD1C18.svg?logo=arXiv)](https://arxiv.org/abs/2406.07476) <br>
21
+ [![License](https://img.shields.io/badge/License-Apache%202.0-yellow)](https://github.com/DAMO-NLP-SG/VideoLLaMA2/blob/main/LICENSE)
22
+ [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FDAMO-NLP-SG%2FVideoLLaMA2&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=Visitor&edge_flat=false)](https://hits.seeyoufarm.com)
23
+ [![GitHub issues](https://img.shields.io/github/issues/DAMO-NLP-SG/VideoLLaMA2?color=critical&label=Issues)](https://github.com/DAMO-NLP-SG/VideoLLaMA2/issues?q=is%3Aopen+is%3Aissue)
24
+ [![GitHub closed issues](https://img.shields.io/github/issues-closed/DAMO-NLP-SG/VideoLLaMA2?color=success&label=Issues)](https://github.com/DAMO-NLP-SG/VideoLLaMA2/issues?q=is%3Aissue+is%3Aclosed) <br>
25
+
26
+ </h5>
27
+
28
+ [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/videollama-2-advancing-spatial-temporal/zero-shot-video-question-answer-on-egoschema-1)](https://paperswithcode.com/sota/zero-shot-video-question-answer-on-egoschema-1?p=videollama-2-advancing-spatial-temporal) <br>
29
+ [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/videollama-2-advancing-spatial-temporal/video-question-answering-on-perception-test)](https://paperswithcode.com/sota/video-question-answering-on-perception-test?p=videollama-2-advancing-spatial-temporal) <br>
30
+ [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/videollama-2-advancing-spatial-temporal/video-question-answering-on-mvbench)](https://paperswithcode.com/sota/video-question-answering-on-mvbench?p=videollama-2-advancing-spatial-temporal) <br>
31
+ [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/videollama-2-advancing-spatial-temporal/zero-shot-video-question-answer-on-video-mme-1)](https://paperswithcode.com/sota/zero-shot-video-question-answer-on-video-mme-1?p=videollama-2-advancing-spatial-temporal) <br>
32
+ [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/videollama-2-advancing-spatial-temporal/zero-shot-video-question-answer-on-video-mme)](https://paperswithcode.com/sota/zero-shot-video-question-answer-on-video-mme?p=videollama-2-advancing-spatial-temporal) <br>
33
+
34
+ <details open><summary>💡 Some other multimodal-LLM projects from our team may interest you ✨. </summary><p>
35
+ <!-- may -->
36
+
37
+ > [**Video-LLaMA: An Instruction-tuned Audio-Visual Language Model for Video Understanding**](https://github.com/DAMO-NLP-SG/Video-LLaMA) <br>
38
+ > Hang Zhang, Xin Li, Lidong Bing <br>
39
+ [![github](https://img.shields.io/badge/-Github-black?logo=github)](https://github.com/DAMO-NLP-SG/Video-LLaMA) [![github](https://img.shields.io/github/stars/DAMO-NLP-SG/Video-LLaMA.svg?style=social)](https://github.com/DAMO-NLP-SG/Video-LLaMA) [![arXiv](https://img.shields.io/badge/Arxiv-2306.02858-b31b1b.svg?logo=arXiv)](https://arxiv.org/abs/2306.02858) <br>
40
+
41
+ > [**VCD: Mitigating Object Hallucinations in Large Vision-Language Models through Visual Contrastive Decoding**](https://arxiv.org/abs/2311.16922) <br>
42
+ > Sicong Leng, Hang Zhang, Guanzheng Chen, Xin Li, Shijian Lu, Chunyan Miao, Lidong Bing <br>
43
+ [![github](https://img.shields.io/badge/-Github-black?logo=github)](https://github.com/DAMO-NLP-SG/VCD) [![github](https://img.shields.io/github/stars/DAMO-NLP-SG/VCD.svg?style=social)](https://github.com/DAMO-NLP-SG/VCD) [![arXiv](https://img.shields.io/badge/Arxiv-2311.16922-b31b1b.svg?logo=arXiv)](https://arxiv.org/abs/2311.16922) <br>
44
+
45
+ </p></details>
46
+
47
+ <div align="center"><video src="https://github.com/DAMO-NLP-SG/VideoLLaMA2/assets/18526640/e0e7951c-f392-42ed-afad-b2c7984d3e38" width="800"></div>
48
+
49
+
50
+ ## 📰 News
51
+ * **[2024.08.14]** Release checkpoints of [VideoLLaMA2-72B-Base](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-72B-Base) and [VideoLLaMA2-72B](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-72B)
52
+ * **[2024.07.30]** Release checkpoints of [VideoLLaMA2-8x7B-Base](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-8x7B-Base) and [VideoLLaMA2-8x7B](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-8x7B).
53
+ * **[2024.06.25]** 🔥🔥 As of Jun 25, our [VideoLLaMA2-7B-16F](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-7B-16F) is the **Top-1** ~7B-sized VideoLLM on the [MLVU Leaderboard](https://github.com/JUNJIE99/MLVU?tab=readme-ov-file#trophy-mini-leaderboard).
54
+ * **[2024.06.18]** 🔥🔥 As of Jun 18, our [VideoLLaMA2-7B-16F](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-7B-16F) is the **Top-1** ~7B-sized VideoLLM on the [VideoMME Leaderboard](https://video-mme.github.io/home_page.html#leaderboard).
55
+ * **[2024.06.17]** 👋👋 Update technical report with the latest results and the missing references. If you have works closely related to VideoLLaMA 2 but not mentioned in the paper, feel free to let us know.
56
+ * **[2024.06.14]** 🔥🔥 [Online Demo](https://huggingface.co/spaces/lixin4ever/VideoLLaMA2) is available.
57
+ * **[2024.06.03]** Release training, evaluation, and serving codes of VideoLLaMA 2.
58
+
59
+
60
+ <img src="https://github.com/DAMO-NLP-SG/VideoLLaMA2/assets/18526640/b9faf24f-bdd2-4728-9385-acea17ea086d" width="800" />
61
+
62
+ ## 🛠️ Requirements and Installation
63
+ Basic Dependencies:
64
+ * Python >= 3.8
65
+ * Pytorch >= 2.2.0
66
+ * CUDA Version >= 11.8
67
+ * transformers == 4.40.0 (for reproducing paper results)
68
+ * tokenizers == 0.19.1
69
+
70
+ **[Online Mode]** Install required packages (better for development):
71
+ ```bash
72
+ git clone https://github.com/DAMO-NLP-SG/VideoLLaMA2
73
+ cd VideoLLaMA2
74
+ pip install -r requirements.txt
75
+ pip install flash-attn==2.5.8 --no-build-isolation
76
+ ```
77
+
78
+ **[Offline Mode]** Install VideoLLaMA2 as a Python package (better for direct use):
79
+ ```bash
80
+ git clone https://github.com/DAMO-NLP-SG/VideoLLaMA2
81
+ cd VideoLLaMA2
82
+ pip install --upgrade pip # enable PEP 660 support
83
+ pip install -e .
84
+ pip install flash-attn==2.5.8 --no-build-isolation
85
+ ```
86
+
87
+ ## 🚀 Main Results
88
+
89
+ ### Multi-Choice Video QA & Video Captioning
90
+ <p><img src="https://github.com/user-attachments/assets/fbe3e3c2-b0f1-4e29-8b92-bc3611192909" width="800" "/></p>
91
+
92
+ ### Open-Ended Video QA
93
+ <p><img src="https://github.com/user-attachments/assets/cee2efe1-309e-4301-a217-e2a848799953" width="800" "/></p>
94
+
95
+
96
+
97
+ ## :earth_americas: Model Zoo
98
+ | Model Name | Model Type | Visual Encoder | Language Decoder | # Training Frames |
99
+ |:----------------|:------------:|:----------------|:------------------|:----------------:|
100
+ | [VideoLLaMA2-7B-Base](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-7B-Base) | Base | [clip-vit-large-patch14-336](https://huggingface.co/openai/clip-vit-large-patch14-336) | [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) | 8 |
101
+ | [VideoLLaMA2-7B](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-7B) | Chat | [clip-vit-large-patch14-336](https://huggingface.co/openai/clip-vit-large-patch14-336) | [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) | 8 |
102
+ | [VideoLLaMA2-7B-16F-Base](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-7B-16F-Base) | Base | [clip-vit-large-patch14-336](https://huggingface.co/openai/clip-vit-large-patch14-336) | [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) | 16 |
103
+ | [VideoLLaMA2-7B-16F](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-7B-16F) | Chat | [clip-vit-large-patch14-336](https://huggingface.co/openai/clip-vit-large-patch14-336) | [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) | 16 |
104
+ | [VideoLLaMA2-8x7B-Base](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-8x7B-Base) | Base | [clip-vit-large-patch14-336](https://huggingface.co/openai/clip-vit-large-patch14-336) | [Mixtral-8x7B-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1) | 8 |
105
+ | [VideoLLaMA2-8x7B](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-8x7B) | Chat | [clip-vit-large-patch14-336](https://huggingface.co/openai/clip-vit-large-patch14-336) | [Mixtral-8x7B-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1) | 8 |
106
+ | [VideoLLaMA2-72B-Base](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-72B-Base) | Base | [clip-vit-large-patch14-336](https://huggingface.co/openai/clip-vit-large-patch14-336) | [Qwen2-72B-Instruct](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | 8 |
107
+ | [VideoLLaMA2-72B](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-72B) | Chat | [clip-vit-large-patch14-336](https://huggingface.co/openai/clip-vit-large-patch14-336) | [Qwen2-72B-Instruct](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | 8 |
108
+
109
+
110
+ ## [🤗 Demo](https://huggingface.co/spaces/lixin4ever/VideoLLaMA2)
111
+
112
+ It is highly recommended to try our [online demo](https://huggingface.co/spaces/lixin4ever/VideoLLaMA2) first.
113
+
114
+ To run a video-based LLM (Large Language Model) web demonstration on your device, you will first need to ensure that you have the necessary model checkpoints prepared, followed by adhering to the steps outlined to successfully launch the demo.
115
+
116
+ ### Single-model Version
117
+
118
+ * Launch a gradio app directly ([VideoLLaMA2-7B](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA2-7B) is adopted by default):
119
+ ```bash
120
+ python videollama2/serve/gradio_web_server_adhoc.py
121
+ ```
122
+
123
+ ### Multi-model Version
124
+
125
+ 1. Launch a global controller
126
+ ```bash
127
+ cd /path/to/VideoLLaMA2
128
+ python -m videollama2.serve.controller --host 0.0.0.0 --port 10000
129
+ ```
130
+
131
+ 2. Launch a gradio webserver
132
+ ```bash
133
+ python -m videollama2.serve.gradio_web_server --controller http://localhost:10000 --model-list-mode reload
134
+ ```
135
+
136
+ 3. Launch one or multiple model workers
137
+ ```bash
138
+ # export HF_ENDPOINT=https://hf-mirror.com # If you are unable to access Hugging Face, try to uncomment this line.
139
+ python -m videollama2.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40000 --worker http://localhost:40000 --model-path /PATH/TO/MODEL1
140
+ python -m videollama2.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40001 --worker http://localhost:40001 --model-path /PATH/TO/MODEL2
141
+ python -m videollama2.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40002 --worker http://localhost:40002 --model-path /PATH/TO/MODEL3
142
+ ...
143
+ ```
144
+
145
+
146
+ ## 🗝️ Training & Evaluation
147
+
148
+ ### Quick Start
149
+
150
+ To facilitate further development on top of our codebase, we provide a quick-start guide on how to train a customized [VideoLLaMA2](https://github.com/DAMO-NLP-SG/VideoLLaMA2) with [VideoLLaVA](https://github.com/PKU-YuanGroup/Video-LLaVA) dataset and evaluate the trained model on the mainstream video-llm benchmarks.
151
+
152
+ 1. Training Data Structure:
153
+ ```bash
154
+ VideoLLaMA2
155
+ ├── datasets
156
+ │ ├── videollava_pt
157
+ | | ├── llava_image/ # Available at: https://pan.baidu.com/s/17GYcE69FcJjjUM0e4Gad2w?pwd=9ga3 or https://drive.google.com/drive/folders/1QmFj2FcMAoWNCUyiUtdcW0-IOhLbOBcf?usp=drive_link
158
+ | | ├── valley/ # Available at: https://pan.baidu.com/s/1jluOimE7mmihEBfnpwwCew?pwd=jyjz or https://drive.google.com/drive/folders/1QmFj2FcMAoWNCUyiUtdcW0-IOhLbOBcf?usp=drive_link
159
+ | | └── valley_llavaimage.json # Available at: https://drive.google.com/file/d/1zGRyVSUMoczGq6cjQFmT0prH67bu2wXD/view, including 703K video-text and 558K image-text pairs
160
+ │ ├── videollava_sft
161
+ | | ├── llava_image_tune/ # Available at: https://pan.baidu.com/s/1l-jT6t_DlN5DTklwArsqGw?pwd=o6ko
162
+ | | ├── videochatgpt_tune/ # Available at: https://pan.baidu.com/s/10hJ_U7wVmYTUo75YHc_n8g?pwd=g1hf
163
+ | | └── videochatgpt_llavaimage_tune.json # Available at: https://drive.google.com/file/d/1zGRyVSUMoczGq6cjQFmT0prH67bu2wXD/view, including 100K video-centric, 625K image-centric and 40K text-only conversations
164
+ ```
165
+ 2. Command:
166
+ ```bash
167
+ # VideoLLaMA2-vllava pretraining
168
+ bash scripts/vllava/pretrain.sh
169
+ # VideoLLaMA2-vllava finetuning
170
+ bash scripts/vllava/finetune.sh
171
+ ```
172
+ 3. Evaluation Data Structure:
173
+ ```bash
174
+ VideoLLaMA2
175
+ ├── eval
176
+ │ ├── egoschema # Official website: https://github.com/egoschema/EgoSchema
177
+ | | ├── good_clips_git/ # Available at: https://drive.google.com/drive/folders/1SS0VVz8rML1e5gWq7D7VtP1oxE2UtmhQ
178
+ | | └── questions.json # Available at: https://github.com/egoschema/EgoSchema/blob/main/questions.json
179
+ │ ├── mvbench # Official website: https://huggingface.co/datasets/OpenGVLab/MVBench
180
+ | | ├── video/
181
+ | | | ├── clever/
182
+ | | | └── ...
183
+ | | └── json/
184
+ | | | ├── action_antonym.json
185
+ | | | └── ...
186
+ │ ├── perception_test_mcqa # Official website: https://huggingface.co/datasets/OpenGVLab/MVBench
187
+ | | ├── videos/ # Available at: https://storage.googleapis.com/dm-perception-test/zip_data/test_videos.zip
188
+ | | └── mc_question_test.json # Download from https://storage.googleapis.com/dm-perception-test/zip_data/mc_question_test_annotations.zip
189
+ │ ├── videomme # Official website: https://video-mme.github.io/home_page.html#leaderboard
190
+ | | ├── test-00000-of-00001.parquet
191
+ | | ├── videos/
192
+ | | └── subtitles/
193
+ │ ├── Activitynet_Zero_Shot_QA # Official website: https://github.com/MILVLG/activitynet-qa
194
+ | | ├── all_test/ # Available at: https://mbzuaiac-my.sharepoint.com/:u:/g/personal/hanoona_bangalath_mbzuai_ac_ae/EatOpE7j68tLm2XAd0u6b8ABGGdVAwLMN6rqlDGM_DwhVA?e=90WIuW
195
+ | | ├── test_q.json # Available at: https://github.com/MILVLG/activitynet-qa/tree/master/dataset
196
+ | | └── test_a.json # Available at: https://github.com/MILVLG/activitynet-qa/tree/master/dataset
197
+ │ ├── MSVD_Zero_Shot_QA # Official website: https://github.com/xudejing/video-question-answering
198
+ | | ├── videos/
199
+ | | ├── test_q.json
200
+ | | └── test_a.json
201
+ │ ├── videochatgpt_gen # Official website: https://github.com/mbzuai-oryx/Video-ChatGPT/tree/main/quantitative_evaluation
202
+ | | ├── Test_Videos/ # Available at: https://mbzuaiac-my.sharepoint.com/:u:/g/personal/hanoona_bangalath_mbzuai_ac_ae/EatOpE7j68tLm2XAd0u6b8ABGGdVAwLMN6rqlDGM_DwhVA?e=90WIuW
203
+ | | ├── Test_Human_Annotated_Captions/ # Available at: https://mbzuaiac-my.sharepoint.com/personal/hanoona_bangalath_mbzuai_ac_ae/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fhanoona%5Fbangalath%5Fmbzuai%5Fac%5Fae%2FDocuments%2FVideo%2DChatGPT%2FData%5FCode%5FModel%5FRelease%2FQuantitative%5FEvaluation%2Fbenchamarking%2FTest%5FHuman%5FAnnotated%5FCaptions%2Ezip&parent=%2Fpersonal%2Fhanoona%5Fbangalath%5Fmbzuai%5Fac%5Fae%2FDocuments%2FVideo%2DChatGPT%2FData%5FCode%5FModel%5FRelease%2FQuantitative%5FEvaluation%2Fbenchamarking&ga=1
204
+ | | ├── generic_qa.json # These three json files available at: https://mbzuaiac-my.sharepoint.com/personal/hanoona_bangalath_mbzuai_ac_ae/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fhanoona%5Fbangalath%5Fmbzuai%5Fac%5Fae%2FDocuments%2FVideo%2DChatGPT%2FData%5FCode%5FModel%5FRelease%2FQuantitative%5FEvaluation%2Fbenchamarking%2FBenchmarking%5FQA&ga=1
205
+ | | ├── temporal_qa.json
206
+ | | └── consistency_qa.json
207
+ ```
208
+ 4. Command:
209
+ ```bash
210
+ # mvbench evaluation
211
+ CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash scripts/eval/eval_video_qa_mvbench.sh
212
+ # activitynet-qa evaluation (need to set azure openai key/endpoint/deployname)
213
+ CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash scripts/eval/eval_video_qa_mvbench.sh
214
+ ```
215
+
216
+ ### Data Format
217
+
218
+ If you want to train a video-llm on your data, you need to follow the procedures below to prepare the video/image sft data:
219
+
220
+ 1. Suppose your data structure is like:
221
+ ```bash
222
+ VideoLLaMA2
223
+ ├── datasets
224
+ │ ├── custom_sft
225
+ │ | ├── images
226
+ │ | ├── videos
227
+ | | └── custom.json
228
+ ```
229
+ 2. Then you should re-organize the annotated video/image sft data according to the following format:
230
+ ```json
231
+ [
232
+ {
233
+ "id": 0,
234
+ "video": "images/xxx.jpg",
235
+ "conversations": [
236
+ {
237
+ "from": "human",
238
+ "value": "<image>\nWhat are the colors of the bus in the image?"
239
+ },
240
+ {
241
+ "from": "gpt",
242
+ "value": "The bus in the image is white and red."
243
+ },
244
+ ...
245
+ ],
246
+ }
247
+ {
248
+ "id": 1,
249
+ "video": "videos/xxx.mp4",
250
+ "conversations": [
251
+ {
252
+ "from": "human",
253
+ "value": "<video>\nWhat are the main activities that take place in the video?"
254
+ },
255
+ {
256
+ "from": "gpt",
257
+ "value": "The main activities that take place in the video are the preparation of camera equipment by a man, a group of men riding a helicopter, and a man sailing a boat through the water."
258
+ },
259
+ ...
260
+ ],
261
+ },
262
+ ...
263
+ ]
264
+ ```
265
+ 3. Modify the `scripts/custom/finetune.sh`:
266
+ ```bash
267
+ ...
268
+ --data_path datasets/custom_sft/custom.json
269
+ --data_folder datasets/custom_sft/
270
+ --pretrain_mm_mlp_adapter CONNECTOR_DOWNLOAD_PATH (e.g., DAMO-NLP-SG/VideoLLaMA2-7B-Base)
271
+ ...
272
+ ```
273
+
274
+ ## 🤖 Inference
275
+
276
+ Video/Image Inference:
277
+ ```python
278
+ import sys
279
+ sys.path.append('./')
280
+ from videollama2 import model_init, mm_infer
281
+ from videollama2.utils import disable_torch_init
282
+
283
+
284
+ def inference():
285
+ disable_torch_init()
286
+
287
+ # Video Inference
288
+ modal = 'video'
289
+ modal_path = 'assets/cat_and_chicken.mp4'
290
+ instruct = 'What animals are in the video, what are they doing, and how does the video feel?'
291
+ # Reply:
292
+ # The video features a kitten and a baby chick playing together. The kitten is seen laying on the floor while the baby chick hops around. The two animals interact playfully with each other, and the video has a cute and heartwarming feel to it.
293
+
294
+ # Image Inference
295
+ modal = 'image'
296
+ modal_path = 'assets/sora.png'
297
+ instruct = 'What is the woman wearing, what is she doing, and how does the image feel?'
298
+ # Reply:
299
+ # The woman in the image is wearing a black coat and sunglasses, and she is walking down a rain-soaked city street. The image feels vibrant and lively, with the bright city lights reflecting off the wet pavement, creating a visually appealing atmosphere. The woman's presence adds a sense of style and confidence to the scene, as she navigates the bustling urban environment.
300
+
301
+ model_path = 'DAMO-NLP-SG/VideoLLaMA2-7B'
302
+ # Base model inference (only need to replace model_path)
303
+ # model_path = 'DAMO-NLP-SG/VideoLLaMA2-7B-Base'
304
+ model, processor, tokenizer = model_init(model_path)
305
+ output = mm_infer(processor[modal](modal_path), instruct, model=model, tokenizer=tokenizer, do_sample=False, modal=modal)
306
+
307
+ print(output)
308
+
309
+ if __name__ == "__main__":
310
+ inference()
311
+ ```
312
+
313
+ ## 📑 Citation
314
+
315
+ If you find VideoLLaMA useful for your research and applications, please cite using this BibTeX:
316
+ ```bibtex
317
+ @article{damonlpsg2024videollama2,
318
+ title={VideoLLaMA 2: Advancing Spatial-Temporal Modeling and Audio Understanding in Video-LLMs},
319
+ author={Cheng, Zesen and Leng, Sicong and Zhang, Hang and Xin, Yifei and Li, Xin and Chen, Guanzheng and Zhu, Yongxin and Zhang, Wenqi and Luo, Ziyang and Zhao, Deli and Bing, Lidong},
320
+ journal={arXiv preprint arXiv:2406.07476},
321
+ year={2024},
322
+ url = {https://arxiv.org/abs/2406.07476}
323
+ }
324
+
325
+ @article{damonlpsg2023videollama,
326
+ title = {Video-LLaMA: An Instruction-tuned Audio-Visual Language Model for Video Understanding},
327
+ author = {Zhang, Hang and Li, Xin and Bing, Lidong},
328
+ journal = {arXiv preprint arXiv:2306.02858},
329
+ year = {2023},
330
+ url = {https://arxiv.org/abs/2306.02858}
331
+ }
332
+ ```
333
+
334
+ ## 👍 Acknowledgement
335
+ The codebase of VideoLLaMA 2 is adapted from [**LLaVA 1.5**](https:github.com/haotian-liu/LLaVA) and [**FastChat**](https://github.com/lm-sys/FastChat). We are also grateful for the following projects our VideoLLaMA 2 arise from:
336
+ * [**LLaMA 2**](https://github.com/meta-llama/llama), [**Mistral-7B**](https://mistral.ai/news/announcing-mistral-7b/), [**OpenAI CLIP**](https://openai.com/index/clip/), [**Honeybee**](https://github.com/kakaobrain/honeybee).
337
+ * [**Video-ChatGPT**](https://github.com/mbzuai-oryx/Video-ChatGPT), [**Video-LLaVA**](https://github.com/PKU-YuanGroup/Video-LLaVA).
338
+ * [**WebVid**](https://github.com/m-bain/webvid), [**Panda-70M**](https://github.com/snap-research/Panda-70M), [**LanguageBind**](https://github.com/PKU-YuanGroup/LanguageBind), [**InternVid**](https://github.com/OpenGVLab/InternVideo/tree/main/Data/InternVid).
339
+ * [**VideoChat2**](https://github.com/OpenGVLab/Ask-Anything/tree/main/video_chat2), [**Valley**](https://github.com/RupertLuo/Valley), [**VTimeLLM**](https://github.com/huangb23/VTimeLLM), [**ShareGPT4V**](https://sharegpt4v.github.io/).
340
+
341
+
342
+ ## 🔒 License
343
+
344
+ This project is released under the Apache 2.0 license as found in the LICENSE file.
345
+ The service is a research preview intended for **non-commercial use ONLY**, subject to the model Licenses of LLaMA and Mistral, Terms of Use of the data generated by OpenAI, and Privacy Practices of ShareGPT. Please get in touch with us if you find any potential violations.
assets/cat_and_chicken.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f24723064ee27ea8fc7a30b4542601ed03a42952c0d20fe918213cf876bfec4
3
+ size 18956323
assets/logo.png ADDED
assets/pipeline.png ADDED

Git LFS Details

  • SHA256: eeab6d9f13787337b40399427e419506f49b55a4fb4fe40ba91e25618d03eeb0
  • Pointer size: 132 Bytes
  • Size of remote file: 4.38 MB
assets/sora.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24e5f0ea3353f23225d00efcdf136fa6dc346301fc34082790e2152c80fa0490
3
+ size 14978533
assets/sora.png ADDED

Git LFS Details

  • SHA256: 6b69de5c87b429c7b1a87de6f9cb3f5ec6aec5f58ab6ab7c0f727a5d0ec259a5
  • Pointer size: 132 Bytes
  • Size of remote file: 1.05 MB
aws/README.md ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AWS CLI v2
2
+
3
+ This bundle contains a built executable of the AWS CLI v2.
4
+
5
+ ## Installation
6
+
7
+ To install the AWS CLI v2, run the `install` script:
8
+ ```
9
+ $ sudo ./install
10
+ You can now run: /usr/local/bin/aws --version
11
+ ```
12
+ This will install the AWS CLI v2 at `/usr/local/bin/aws`. Assuming
13
+ `/usr/local/bin` is on your `PATH`, you can now run:
14
+ ```
15
+ $ aws --version
16
+ ```
17
+
18
+
19
+ ### Installing without sudo
20
+
21
+ If you don't have ``sudo`` permissions or want to install the AWS
22
+ CLI v2 only for the current user, run the `install` script with the `-b`
23
+ and `-i` options:
24
+ ```
25
+ $ ./install -i ~/.local/aws-cli -b ~/.local/bin
26
+ ```
27
+ This will install the AWS CLI v2 in `~/.local/aws-cli` and create
28
+ symlinks for `aws` and `aws_completer` in `~/.local/bin`. For more
29
+ information about these options, run the `install` script with `-h`:
30
+ ```
31
+ $ ./install -h
32
+ ```
33
+
34
+ ### Updating
35
+
36
+ If you run the `install` script and there is a previously installed version
37
+ of the AWS CLI v2, the script will error out. To update to the version included
38
+ in this bundle, run the `install` script with `--update`:
39
+ ```
40
+ $ sudo ./install --update
41
+ ```
42
+
43
+
44
+ ### Removing the installation
45
+
46
+ To remove the AWS CLI v2, delete the its installation and symlinks:
47
+ ```
48
+ $ sudo rm -rf /usr/local/aws-cli
49
+ $ sudo rm /usr/local/bin/aws
50
+ $ sudo rm /usr/local/bin/aws_completer
51
+ ```
52
+ Note if you installed the AWS CLI v2 using the `-b` or `-i` options, you will
53
+ need to remove the installation and the symlinks in the directories you
54
+ specified.
aws/THIRD_PARTY_LICENSES ADDED
@@ -0,0 +1,1468 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ** cryptography 3.3.2; version 3.3.2 --
2
+ https://github.com/pyca/cryptography/tree/3.3.2
3
+ Copyright (c) Individual contributors.
4
+ All rights reserved.
5
+
6
+ This software is made available under the terms of *either* of the licenses
7
+ found in LICENSE.APACHE or LICENSE.BSD. Contributions to cryptography are made
8
+ under the terms of *both* these licenses.
9
+
10
+ The code used in the OpenSSL locking callback and OS random engine is derived
11
+ from CPython, and is licensed under the terms of the PSF License Agreement.
12
+
13
+ * For cryptography 3.3.2 see also this required NOTICE:
14
+ Copyright (c) Individual contributors.
15
+ All rights reserved.
16
+
17
+ ------
18
+
19
+ ** botocore; version 2 -- https://github.com/boto/botocore/tree/v2
20
+ Botocore
21
+ Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
+
23
+ ----
24
+
25
+ Botocore includes a vendorized copy of the requests python library to ease
26
+ installation.
27
+
28
+ Requests License
29
+ ================
30
+
31
+ Copyright 2013 Kenneth Reitz
32
+
33
+ Licensed under the Apache License, Version 2.0 (the "License");
34
+ you may not use this file except in compliance with the License.
35
+ You may obtain a copy of the License at
36
+
37
+ http://www.apache.org/licenses/LICENSE-2.0
38
+
39
+ Unless required by applicable law or agreed to in writing, software
40
+ distributed under the License is distributed on an "AS IS" BASIS,
41
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42
+ See the License for the specific language governing permissions and
43
+ limitations under the License.
44
+
45
+
46
+ The requests library also includes some vendorized python libraries to ease
47
+ installation.
48
+
49
+ Urllib3 License
50
+ ===============
51
+
52
+ This is the MIT license: http://www.opensource.org/licenses/mit-license.php
53
+
54
+ Copyright 2008-2011 Andrey Petrov and contributors (see CONTRIBUTORS.txt),
55
+ Modifications copyright 2012 Kenneth Reitz.
56
+
57
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
58
+ this
59
+ software and associated documentation files (the "Software"), to deal in the
60
+ Software
61
+ without restriction, including without limitation the rights to use, copy,
62
+ modify, merge,
63
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
64
+ permit persons
65
+ to whom the Software is furnished to do so, subject to the following
66
+ conditions:
67
+
68
+ The above copyright notice and this permission notice shall be included in all
69
+ copies or
70
+ substantial portions of the Software.
71
+
72
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
+ IMPLIED,
74
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
75
+ PARTICULAR
76
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
77
+ BE LIABLE
78
+ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
79
+ TORT OR
80
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
81
+ OR OTHER
82
+ DEALINGS IN THE SOFTWARE.
83
+
84
+ Chardet License
85
+ ===============
86
+
87
+ This library is free software; you can redistribute it and/or
88
+ modify it under the terms of the GNU Lesser General Public
89
+ License as published by the Free Software Foundation; either
90
+ version 2.1 of the License, or (at your option) any later version.
91
+
92
+ This library is distributed in the hope that it will be useful,
93
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
94
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
95
+ Lesser General Public License for more details.
96
+
97
+ You should have received a copy of the GNU Lesser General Public
98
+ License along with this library; if not, write to the Free Software
99
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
100
+ 02110-1301 USA
101
+
102
+ Bundle of CA Root Certificates
103
+ ==============================
104
+
105
+ This library is free software; you can redistribute it and/or
106
+ modify it under the terms of the GNU Lesser General Public
107
+ License as published by the Free Software Foundation; either
108
+ version 2.1 of the License, or (at your option) any later version.
109
+
110
+ This library is distributed in the hope that it will be useful,
111
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
112
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
113
+ Lesser General Public License for more details.
114
+
115
+ You should have received a copy of the GNU Lesser General Public
116
+ License along with this library; if not, write to the Free Software
117
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
118
+ 02110-1301
119
+ ** s3transfer; version 0 -- https://github.com/boto/s3transfer
120
+ s3transfer
121
+ Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
122
+
123
+ Apache License
124
+
125
+ Version 2.0, January 2004
126
+
127
+ http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND
128
+ DISTRIBUTION
129
+
130
+ 1. Definitions.
131
+
132
+ "License" shall mean the terms and conditions for use, reproduction, and
133
+ distribution as defined by Sections 1 through 9 of this document.
134
+
135
+ "Licensor" shall mean the copyright owner or entity authorized by the
136
+ copyright owner that is granting the License.
137
+
138
+ "Legal Entity" shall mean the union of the acting entity and all other
139
+ entities that control, are controlled by, or are under common control
140
+ with that entity. For the purposes of this definition, "control" means
141
+ (i) the power, direct or indirect, to cause the direction or management
142
+ of such entity, whether by contract or otherwise, or (ii) ownership of
143
+ fifty percent (50%) or more of the outstanding shares, or (iii)
144
+ beneficial ownership of such entity.
145
+
146
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
147
+ permissions granted by this License.
148
+
149
+ "Source" form shall mean the preferred form for making modifications,
150
+ including but not limited to software source code, documentation source,
151
+ and configuration files.
152
+
153
+ "Object" form shall mean any form resulting from mechanical
154
+ transformation or translation of a Source form, including but not limited
155
+ to compiled object code, generated documentation, and conversions to
156
+ other media types.
157
+
158
+ "Work" shall mean the work of authorship, whether in Source or Object
159
+ form, made available under the License, as indicated by a copyright
160
+ notice that is included in or attached to the work (an example is
161
+ provided in the Appendix below).
162
+
163
+ "Derivative Works" shall mean any work, whether in Source or Object form,
164
+ that is based on (or derived from) the Work and for which the editorial
165
+ revisions, annotations, elaborations, or other modifications represent,
166
+ as a whole, an original work of authorship. For the purposes of this
167
+ License, Derivative Works shall not include works that remain separable
168
+ from, or merely link (or bind by name) to the interfaces of, the Work and
169
+ Derivative Works thereof.
170
+
171
+ "Contribution" shall mean any work of authorship, including the original
172
+ version of the Work and any modifications or additions to that Work or
173
+ Derivative Works thereof, that is intentionally submitted to Licensor for
174
+ inclusion in the Work by the copyright owner or by an individual or Legal
175
+ Entity authorized to submit on behalf of the copyright owner. For the
176
+ purposes of this definition, "submitted" means any form of electronic,
177
+ verbal, or written communication sent to the Licensor or its
178
+ representatives, including but not limited to communication on electronic
179
+ mailing lists, source code control systems, and issue tracking systems
180
+ that are managed by, or on behalf of, the Licensor for the purpose of
181
+ discussing and improving the Work, but excluding communication that is
182
+ conspicuously marked or otherwise designated in writing by the copyright
183
+ owner as "Not a Contribution."
184
+
185
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
186
+ behalf of whom a Contribution has been received by Licensor and
187
+ subsequently incorporated within the Work.
188
+
189
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
190
+ License, each Contributor hereby grants to You a perpetual, worldwide,
191
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
192
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
193
+ sublicense, and distribute the Work and such Derivative Works in Source or
194
+ Object form.
195
+
196
+ 3. Grant of Patent License. Subject to the terms and conditions of this
197
+ License, each Contributor hereby grants to You a perpetual, worldwide,
198
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
199
+ this section) patent license to make, have made, use, offer to sell, sell,
200
+ import, and otherwise transfer the Work, where such license applies only to
201
+ those patent claims licensable by such Contributor that are necessarily
202
+ infringed by their Contribution(s) alone or by combination of their
203
+ Contribution(s) with the Work to which such Contribution(s) was submitted.
204
+ If You institute patent litigation against any entity (including a
205
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
206
+ Contribution incorporated within the Work constitutes direct or contributory
207
+ patent infringement, then any patent licenses granted to You under this
208
+ License for that Work shall terminate as of the date such litigation is
209
+ filed.
210
+
211
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
212
+ Derivative Works thereof in any medium, with or without modifications, and
213
+ in Source or Object form, provided that You meet the following conditions:
214
+
215
+ (a) You must give any other recipients of the Work or Derivative Works a
216
+ copy of this License; and
217
+
218
+ (b) You must cause any modified files to carry prominent notices stating
219
+ that You changed the files; and
220
+
221
+ (c) You must retain, in the Source form of any Derivative Works that You
222
+ distribute, all copyright, patent, trademark, and attribution notices
223
+ from the Source form of the Work, excluding those notices that do not
224
+ pertain to any part of the Derivative Works; and
225
+
226
+ (d) If the Work includes a "NOTICE" text file as part of its
227
+ distribution, then any Derivative Works that You distribute must include
228
+ a readable copy of the attribution notices contained within such NOTICE
229
+ file, excluding those notices that do not pertain to any part of the
230
+ Derivative Works, in at least one of the following places: within a
231
+ NOTICE text file distributed as part of the Derivative Works; within the
232
+ Source form or documentation, if provided along with the Derivative
233
+ Works; or, within a display generated by the Derivative Works, if and
234
+ wherever such third-party notices normally appear. The contents of the
235
+ NOTICE file are for informational purposes only and do not modify the
236
+ License. You may add Your own attribution notices within Derivative Works
237
+ that You distribute, alongside or as an addendum to the NOTICE text from
238
+ the Work, provided that such additional attribution notices cannot be
239
+ construed as modifying the License.
240
+
241
+ You may add Your own copyright statement to Your modifications and may
242
+ provide additional or different license terms and conditions for use,
243
+ reproduction, or distribution of Your modifications, or for any such
244
+ Derivative Works as a whole, provided Your use, reproduction, and
245
+ distribution of the Work otherwise complies with the conditions stated in
246
+ this License.
247
+
248
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
249
+ Contribution intentionally submitted for inclusion in the Work by You to the
250
+ Licensor shall be under the terms and conditions of this License, without
251
+ any additional terms or conditions. Notwithstanding the above, nothing
252
+ herein shall supersede or modify the terms of any separate license agreement
253
+ you may have executed with Licensor regarding such Contributions.
254
+
255
+ 6. Trademarks. This License does not grant permission to use the trade
256
+ names, trademarks, service marks, or product names of the Licensor, except
257
+ as required for reasonable and customary use in describing the origin of the
258
+ Work and reproducing the content of the NOTICE file.
259
+
260
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
261
+ writing, Licensor provides the Work (and each Contributor provides its
262
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
263
+ KIND, either express or implied, including, without limitation, any
264
+ warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
265
+ FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining
266
+ the appropriateness of using or redistributing the Work and assume any risks
267
+ associated with Your exercise of permissions under this License.
268
+
269
+ 8. Limitation of Liability. In no event and under no legal theory, whether
270
+ in tort (including negligence), contract, or otherwise, unless required by
271
+ applicable law (such as deliberate and grossly negligent acts) or agreed to
272
+ in writing, shall any Contributor be liable to You for damages, including
273
+ any direct, indirect, special, incidental, or consequential damages of any
274
+ character arising as a result of this License or out of the use or inability
275
+ to use the Work (including but not limited to damages for loss of goodwill,
276
+ work stoppage, computer failure or malfunction, or any and all other
277
+ commercial damages or losses), even if such Contributor has been advised of
278
+ the possibility of such damages.
279
+
280
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work
281
+ or Derivative Works thereof, You may choose to offer, and charge a fee for,
282
+ acceptance of support, warranty, indemnity, or other liability obligations
283
+ and/or rights consistent with this License. However, in accepting such
284
+ obligations, You may act only on Your own behalf and on Your sole
285
+ responsibility, not on behalf of any other Contributor, and only if You
286
+ agree to indemnify, defend, and hold each Contributor harmless for any
287
+ liability incurred by, or claims asserted against, such Contributor by
288
+ reason of your accepting any such warranty or additional liability. END OF
289
+ TERMS AND CONDITIONS
290
+
291
+ APPENDIX: How to apply the Apache License to your work.
292
+
293
+ To apply the Apache License to your work, attach the following boilerplate
294
+ notice, with the fields enclosed by brackets "[]" replaced with your own
295
+ identifying information. (Don't include the brackets!) The text should be
296
+ enclosed in the appropriate comment syntax for the file format. We also
297
+ recommend that a file or class name and description of purpose be included on
298
+ the same "printed page" as the copyright notice for easier identification
299
+ within third-party archives.
300
+
301
+ Copyright [yyyy] [name of copyright owner]
302
+
303
+ Licensed under the Apache License, Version 2.0 (the "License");
304
+
305
+ you may not use this file except in compliance with the License.
306
+
307
+ You may obtain a copy of the License at
308
+
309
+ http://www.apache.org/licenses/LICENSE-2.0
310
+
311
+ Unless required by applicable law or agreed to in writing, software
312
+
313
+ distributed under the License is distributed on an "AS IS" BASIS,
314
+
315
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
316
+
317
+ See the License for the specific language governing permissions and
318
+
319
+ limitations under the License.
320
+
321
+ * For botocore see also this required NOTICE:
322
+ Botocore
323
+ Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights
324
+ Reserved.
325
+
326
+ ----
327
+
328
+ Botocore includes a vendorized copy of the requests python library to ease
329
+ installation.
330
+
331
+ Requests License
332
+ ================
333
+
334
+ Copyright 2013 Kenneth Reitz
335
+
336
+ Licensed under the Apache License, Version 2.0 (the "License");
337
+ you may not use this file except in compliance with the License.
338
+ You may obtain a copy of the License at
339
+
340
+ http://www.apache.org/licenses/LICENSE-2.0
341
+
342
+ Unless required by applicable law or agreed to in writing, software
343
+ distributed under the License is distributed on an "AS IS" BASIS,
344
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
345
+ See the License for the specific language governing permissions and
346
+ limitations under the License.
347
+
348
+
349
+ The requests library also includes some vendorized python libraries to ease
350
+ installation.
351
+
352
+ Urllib3 License
353
+ ===============
354
+
355
+ This is the MIT license: http://www.opensource.org/licenses/mit-license.php
356
+
357
+ Copyright 2008-2011 Andrey Petrov and contributors (see CONTRIBUTORS.txt),
358
+ Modifications copyright 2012 Kenneth Reitz.
359
+
360
+ Permission is hereby granted, free of charge, to any person obtaining a
361
+ copy of this
362
+ software and associated documentation files (the "Software"), to deal in
363
+ the Software
364
+ without restriction, including without limitation the rights to use, copy,
365
+ modify, merge,
366
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
367
+ permit persons
368
+ to whom the Software is furnished to do so, subject to the following
369
+ conditions:
370
+
371
+ The above copyright notice and this permission notice shall be included in
372
+ all copies or
373
+ substantial portions of the Software.
374
+
375
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
376
+ IMPLIED,
377
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
378
+ A PARTICULAR
379
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
380
+ HOLDERS BE LIABLE
381
+ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
382
+ CONTRACT, TORT OR
383
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
384
+ USE OR OTHER
385
+ DEALINGS IN THE SOFTWARE.
386
+
387
+ Chardet License
388
+ ===============
389
+
390
+ This library is free software; you can redistribute it and/or
391
+ modify it under the terms of the GNU Lesser General Public
392
+ License as published by the Free Software Foundation; either
393
+ version 2.1 of the License, or (at your option) any later version.
394
+
395
+ This library is distributed in the hope that it will be useful,
396
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
397
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
398
+ Lesser General Public License for more details.
399
+
400
+ You should have received a copy of the GNU Lesser General Public
401
+ License along with this library; if not, write to the Free Software
402
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
403
+ 02110-1301 USA
404
+
405
+ Bundle of CA Root Certificates
406
+ ==============================
407
+
408
+ This library is free software; you can redistribute it and/or
409
+ modify it under the terms of the GNU Lesser General Public
410
+ License as published by the Free Software Foundation; either
411
+ version 2.1 of the License, or (at your option) any later version.
412
+
413
+ This library is distributed in the hope that it will be useful,
414
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
415
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
416
+ Lesser General Public License for more details.
417
+
418
+ You should have received a copy of the GNU Lesser General Public
419
+ License along with this library; if not, write to the Free Software
420
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
421
+ 02110-1301
422
+ * For s3transfer see also this required NOTICE:
423
+ s3transfer
424
+ Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
425
+
426
+ ------
427
+
428
+ ** colorama; version 0.4.2 -- https://pypi.org/project/colorama/
429
+ Copyright (c) 2010 Jonathan Hartley
430
+ All rights reserved.
431
+
432
+ Copyright (c) 2010 Jonathan Hartley
433
+ All rights reserved.
434
+
435
+ Redistribution and use in source and binary forms, with or without
436
+ modification, are permitted provided that the following conditions are met:
437
+
438
+ * Redistributions of source code must retain the above copyright notice, this
439
+ list of conditions and the following disclaimer.
440
+
441
+ * Redistributions in binary form must reproduce the above copyright notice,
442
+ this list of conditions and the following disclaimer in the documentation
443
+ and/or other materials provided with the distribution.
444
+
445
+ * Neither the name of the copyright holders, nor those of its contributors
446
+ may be used to endorse or promote products derived from this software without
447
+ specific prior written permission.
448
+
449
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
450
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
451
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
452
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
453
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
454
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
455
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
456
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
457
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
458
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
459
+
460
+ ------
461
+
462
+ ** prompt-toolkit; version 2.0.10 --
463
+ https://github.com/prompt-toolkit/python-prompt-toolkit/tree/2.0.10
464
+ Copyright (c) 2014, Jonathan Slenders
465
+ All rights reserved.
466
+
467
+ Copyright (c) 2014, Jonathan Slenders
468
+ All rights reserved.
469
+
470
+ Redistribution and use in source and binary forms, with or without
471
+ modification,
472
+ are permitted provided that the following conditions are met:
473
+
474
+ * Redistributions of source code must retain the above copyright notice, this
475
+ list of conditions and the following disclaimer.
476
+
477
+ * Redistributions in binary form must reproduce the above copyright notice,
478
+ this
479
+ list of conditions and the following disclaimer in the documentation and/or
480
+ other materials provided with the distribution.
481
+
482
+ * Neither the name of the {organization} nor the names of its
483
+ contributors may be used to endorse or promote products derived from
484
+ this software without specific prior written permission.
485
+
486
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
487
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
488
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
489
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
490
+ FOR
491
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
492
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
493
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
494
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
495
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
496
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
497
+
498
+ ------
499
+
500
+ ** dateutil; version 2.8.0 -- https://github.com/dateutil/dateutil/tree/2.8.0
501
+ Copyright 2017- Paul Ganssle <[email protected]>
502
+ Copyright 2017- dateutil contributors (see AUTHORS file)
503
+
504
+ Copyright 2017- Paul Ganssle <[email protected]>
505
+ Copyright 2017- dateutil contributors (see AUTHORS file)
506
+
507
+ Licensed under the Apache License, Version 2.0 (the "License");
508
+ you may not use this file except in compliance with the License.
509
+ You may obtain a copy of the License at
510
+
511
+ http://www.apache.org/licenses/LICENSE-2.0
512
+
513
+ Unless required by applicable law or agreed to in writing, software
514
+ distributed under the License is distributed on an "AS IS" BASIS,
515
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
516
+ See the License for the specific language governing permissions and
517
+ limitations under the License.
518
+
519
+ The above license applies to all contributions after 2017-12-01, as well as
520
+ all contributions that have been re-licensed (see AUTHORS file for the list of
521
+ contributors who have re-licensed their code).
522
+ --------------------------------------------------------------------------------
523
+ dateutil - Extensions to the standard Python datetime module.
524
+
525
+ Copyright (c) 2003-2011 - Gustavo Niemeyer <[email protected]>
526
+ Copyright (c) 2012-2014 - Tomi Pieviläinen <[email protected]>
527
+ Copyright (c) 2014-2016 - Yaron de Leeuw <[email protected]>
528
+ Copyright (c) 2015- - Paul Ganssle <[email protected]>
529
+ Copyright (c) 2015- - dateutil contributors (see AUTHORS file)
530
+
531
+ All rights reserved.
532
+
533
+ Redistribution and use in source and binary forms, with or without
534
+ modification, are permitted provided that the following conditions are met:
535
+
536
+ * Redistributions of source code must retain the above copyright notice,
537
+ this list of conditions and the following disclaimer.
538
+ * Redistributions in binary form must reproduce the above copyright notice,
539
+ this list of conditions and the following disclaimer in the documentation
540
+ and/or other materials provided with the distribution.
541
+ * Neither the name of the copyright holder nor the names of its
542
+ contributors may be used to endorse or promote products derived from
543
+ this software without specific prior written permission.
544
+
545
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
546
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
547
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
548
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
549
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
550
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
551
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
552
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
553
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
554
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
555
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
556
+
557
+ The above BSD License Applies to all code, even that also covered by Apache
558
+ 2.0.
559
+
560
+ ------
561
+
562
+ ** Pyintaller 3.5; version 3.5 --
563
+ https://github.com/pyinstaller/pyinstaller/tree/v3.5
564
+ Copyright (c) 2010-2020, PyInstaller Development Team
565
+ Copyright (c) 2005-2009, Giovanni Bajo
566
+ Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
567
+
568
+ * Package Pyintaller 3.5's source code may be found at:
569
+ https://files.pythonhosted.org/packages/e2/c9/0b44b2ea87ba36395483a672fddd07e6a9cb2b8d3c4a28d7ae76c7e7e1e5/PyInstaller-3.5.tar.gz
570
+
571
+ ================================
572
+ The PyInstaller licensing terms
573
+ ================================
574
+
575
+
576
+ Copyright (c) 2010-2020, PyInstaller Development Team
577
+ Copyright (c) 2005-2009, Giovanni Bajo
578
+ Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
579
+
580
+
581
+ PyInstaller is licensed under the terms of the GNU General Public License
582
+ as published by the Free Software Foundation; either version 2 of the License,
583
+ or (at your option) any later version.
584
+
585
+
586
+ Bootloader Exception
587
+ --------------------
588
+
589
+ In addition to the permissions in the GNU General Public License, the
590
+ authors give you unlimited permission to link or embed compiled bootloader
591
+ and related files into combinations with other programs, and to distribute
592
+ those combinations without any restriction coming from the use of those
593
+ files. (The General Public License restrictions do apply in other respects;
594
+ for example, they cover modification of the files, and distribution when
595
+ not linked into a combined executable.)
596
+
597
+
598
+ Bootloader and Related Files
599
+ ----------------------------
600
+
601
+ Bootloader and related files are files which are embedded within the
602
+ final executable. This includes files in directories:
603
+
604
+ ./bootloader/
605
+ ./PyInstaller/loader
606
+
607
+
608
+ About the PyInstaller Development Team
609
+ --------------------------------------
610
+
611
+ The PyInstaller Development Team is the set of contributors
612
+ to the PyInstaller project. A full list with details is kept
613
+ in the documentation directory, in the file
614
+ ``doc/CREDITS.rst``.
615
+
616
+ The core team that coordinates development on GitHub can be found here:
617
+ https://github.com/pyinstaller/pyinstaller. As of 2015, it consists of:
618
+
619
+ * Hartmut Goebel
620
+ * Martin Zibricky
621
+ * David Vierra
622
+ * David Cortesi
623
+
624
+
625
+ Our Copyright Policy
626
+ --------------------
627
+
628
+ PyInstaller uses a shared copyright model. Each contributor maintains copyright
629
+ over their contributions to PyInstaller. But, it is important to note that
630
+ these
631
+ contributions are typically only changes to the repositories. Thus,
632
+ the PyInstaller source code, in its entirety is not the copyright of any single
633
+ person or institution. Instead, it is the collective copyright of the entire
634
+ PyInstaller Development Team. If individual contributors want to maintain
635
+ a record of what changes/contributions they have specific copyright on, they
636
+ should indicate their copyright in the commit message of the change, when they
637
+ commit the change to the PyInstaller repository.
638
+
639
+ With this in mind, the following banner should be used in any source code file
640
+ to indicate the copyright and license terms:
641
+
642
+
643
+ #-----------------------------------------------------------------------------
644
+ # Copyright (c) 2005-2020, PyInstaller Development Team.
645
+ #
646
+ # Distributed under the terms of the GNU General Public License (version 2
647
+ # or later) with exception for distributing the bootloader.
648
+ #
649
+ # The full license is in the file COPYING.txt, distributed with this software.
650
+ #
651
+ # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
652
+ #-----------------------------------------------------------------------------
653
+
654
+
655
+
656
+ GNU General Public License
657
+ --------------------------
658
+
659
+ https://gnu.org/licenses/gpl-2.0.html
660
+
661
+
662
+ GNU GENERAL PUBLIC LICENSE
663
+ Version 2, June 1991
664
+
665
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
666
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
667
+ Everyone is permitted to copy and distribute verbatim copies
668
+ of this license document, but changing it is not allowed.
669
+
670
+ Preamble
671
+
672
+ The licenses for most software are designed to take away your
673
+ freedom to share and change it. By contrast, the GNU General Public
674
+ License is intended to guarantee your freedom to share and change free
675
+ software--to make sure the software is free for all its users. This
676
+ General Public License applies to most of the Free Software
677
+ Foundation's software and to any other program whose authors commit to
678
+ using it. (Some other Free Software Foundation software is covered by
679
+ the GNU Library General Public License instead.) You can apply it to
680
+ your programs, too.
681
+
682
+ When we speak of free software, we are referring to freedom, not
683
+ price. Our General Public Licenses are designed to make sure that you
684
+ have the freedom to distribute copies of free software (and charge for
685
+ this service if you wish), that you receive source code or can get it
686
+ if you want it, that you can change the software or use pieces of it
687
+ in new free programs; and that you know you can do these things.
688
+
689
+ To protect your rights, we need to make restrictions that forbid
690
+ anyone to deny you these rights or to ask you to surrender the rights.
691
+ These restrictions translate to certain responsibilities for you if you
692
+ distribute copies of the software, or if you modify it.
693
+
694
+ For example, if you distribute copies of such a program, whether
695
+ gratis or for a fee, you must give the recipients all the rights that
696
+ you have. You must make sure that they, too, receive or can get the
697
+ source code. And you must show them these terms so they know their
698
+ rights.
699
+
700
+ We protect your rights with two steps: (1) copyright the software, and
701
+ (2) offer you this license which gives you legal permission to copy,
702
+ distribute and/or modify the software.
703
+
704
+ Also, for each author's protection and ours, we want to make certain
705
+ that everyone understands that there is no warranty for this free
706
+ software. If the software is modified by someone else and passed on, we
707
+ want its recipients to know that what they have is not the original, so
708
+ that any problems introduced by others will not reflect on the original
709
+ authors' reputations.
710
+
711
+ Finally, any free program is threatened constantly by software
712
+ patents. We wish to avoid the danger that redistributors of a free
713
+ program will individually obtain patent licenses, in effect making the
714
+ program proprietary. To prevent this, we have made it clear that any
715
+ patent must be licensed for everyone's free use or not licensed at all.
716
+
717
+ The precise terms and conditions for copying, distribution and
718
+ modification follow.
719
+
720
+ GNU GENERAL PUBLIC LICENSE
721
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
722
+
723
+ 0. This License applies to any program or other work which contains
724
+ a notice placed by the copyright holder saying it may be distributed
725
+ under the terms of this General Public License. The "Program", below,
726
+ refers to any such program or work, and a "work based on the Program"
727
+ means either the Program or any derivative work under copyright law:
728
+ that is to say, a work containing the Program or a portion of it,
729
+ either verbatim or with modifications and/or translated into another
730
+ language. (Hereinafter, translation is included without limitation in
731
+ the term "modification".) Each licensee is addressed as "you".
732
+
733
+ Activities other than copying, distribution and modification are not
734
+ covered by this License; they are outside its scope. The act of
735
+ running the Program is not restricted, and the output from the Program
736
+ is covered only if its contents constitute a work based on the
737
+ Program (independent of having been made by running the Program).
738
+ Whether that is true depends on what the Program does.
739
+
740
+ 1. You may copy and distribute verbatim copies of the Program's
741
+ source code as you receive it, in any medium, provided that you
742
+ conspicuously and appropriately publish on each copy an appropriate
743
+ copyright notice and disclaimer of warranty; keep intact all the
744
+ notices that refer to this License and to the absence of any warranty;
745
+ and give any other recipients of the Program a copy of this License
746
+ along with the Program.
747
+
748
+ You may charge a fee for the physical act of transferring a copy, and
749
+ you may at your option offer warranty protection in exchange for a fee.
750
+
751
+ 2. You may modify your copy or copies of the Program or any portion
752
+ of it, thus forming a work based on the Program, and copy and
753
+ distribute such modifications or work under the terms of Section 1
754
+ above, provided that you also meet all of these conditions:
755
+
756
+ a) You must cause the modified files to carry prominent notices
757
+ stating that you changed the files and the date of any change.
758
+
759
+ b) You must cause any work that you distribute or publish, that in
760
+ whole or in part contains or is derived from the Program or any
761
+ part thereof, to be licensed as a whole at no charge to all third
762
+ parties under the terms of this License.
763
+
764
+ c) If the modified program normally reads commands interactively
765
+ when run, you must cause it, when started running for such
766
+ interactive use in the most ordinary way, to print or display an
767
+ announcement including an appropriate copyright notice and a
768
+ notice that there is no warranty (or else, saying that you provide
769
+ a warranty) and that users may redistribute the program under
770
+ these conditions, and telling the user how to view a copy of this
771
+ License. (Exception: if the Program itself is interactive but
772
+ does not normally print such an announcement, your work based on
773
+ the Program is not required to print an announcement.)
774
+
775
+ These requirements apply to the modified work as a whole. If
776
+ identifiable sections of that work are not derived from the Program,
777
+ and can be reasonably considered independent and separate works in
778
+ themselves, then this License, and its terms, do not apply to those
779
+ sections when you distribute them as separate works. But when you
780
+ distribute the same sections as part of a whole which is a work based
781
+ on the Program, the distribution of the whole must be on the terms of
782
+ this License, whose permissions for other licensees extend to the
783
+ entire whole, and thus to each and every part regardless of who wrote it.
784
+
785
+ Thus, it is not the intent of this section to claim rights or contest
786
+ your rights to work written entirely by you; rather, the intent is to
787
+ exercise the right to control the distribution of derivative or
788
+ collective works based on the Program.
789
+
790
+ In addition, mere aggregation of another work not based on the Program
791
+ with the Program (or with a work based on the Program) on a volume of
792
+ a storage or distribution medium does not bring the other work under
793
+ the scope of this License.
794
+
795
+ 3. You may copy and distribute the Program (or a work based on it,
796
+ under Section 2) in object code or executable form under the terms of
797
+ Sections 1 and 2 above provided that you also do one of the following:
798
+
799
+ a) Accompany it with the complete corresponding machine-readable
800
+ source code, which must be distributed under the terms of Sections
801
+ 1 and 2 above on a medium customarily used for software interchange; or,
802
+
803
+ b) Accompany it with a written offer, valid for at least three
804
+ years, to give any third party, for a charge no more than your
805
+ cost of physically performing source distribution, a complete
806
+ machine-readable copy of the corresponding source code, to be
807
+ distributed under the terms of Sections 1 and 2 above on a medium
808
+ customarily used for software interchange; or,
809
+
810
+ c) Accompany it with the information you received as to the offer
811
+ to distribute corresponding source code. (This alternative is
812
+ allowed only for noncommercial distribution and only if you
813
+ received the program in object code or executable form with such
814
+ an offer, in accord with Subsection b above.)
815
+
816
+ The source code for a work means the preferred form of the work for
817
+ making modifications to it. For an executable work, complete source
818
+ code means all the source code for all modules it contains, plus any
819
+ associated interface definition files, plus the scripts used to
820
+ control compilation and installation of the executable. However, as a
821
+ special exception, the source code distributed need not include
822
+ anything that is normally distributed (in either source or binary
823
+ form) with the major components (compiler, kernel, and so on) of the
824
+ operating system on which the executable runs, unless that component
825
+ itself accompanies the executable.
826
+
827
+ If distribution of executable or object code is made by offering
828
+ access to copy from a designated place, then offering equivalent
829
+ access to copy the source code from the same place counts as
830
+ distribution of the source code, even though third parties are not
831
+ compelled to copy the source along with the object code.
832
+
833
+ 4. You may not copy, modify, sublicense, or distribute the Program
834
+ except as expressly provided under this License. Any attempt
835
+ otherwise to copy, modify, sublicense or distribute the Program is
836
+ void, and will automatically terminate your rights under this License.
837
+ However, parties who have received copies, or rights, from you under
838
+ this License will not have their licenses terminated so long as such
839
+ parties remain in full compliance.
840
+
841
+ 5. You are not required to accept this License, since you have not
842
+ signed it. However, nothing else grants you permission to modify or
843
+ distribute the Program or its derivative works. These actions are
844
+ prohibited by law if you do not accept this License. Therefore, by
845
+ modifying or distributing the Program (or any work based on the
846
+ Program), you indicate your acceptance of this License to do so, and
847
+ all its terms and conditions for copying, distributing or modifying
848
+ the Program or works based on it.
849
+
850
+ 6. Each time you redistribute the Program (or any work based on the
851
+ Program), the recipient automatically receives a license from the
852
+ original licensor to copy, distribute or modify the Program subject to
853
+ these terms and conditions. You may not impose any further
854
+ restrictions on the recipients' exercise of the rights granted herein.
855
+ You are not responsible for enforcing compliance by third parties to
856
+ this License.
857
+
858
+ 7. If, as a consequence of a court judgment or allegation of patent
859
+ infringement or for any other reason (not limited to patent issues),
860
+ conditions are imposed on you (whether by court order, agreement or
861
+ otherwise) that contradict the conditions of this License, they do not
862
+ excuse you from the conditions of this License. If you cannot
863
+ distribute so as to satisfy simultaneously your obligations under this
864
+ License and any other pertinent obligations, then as a consequence you
865
+ may not distribute the Program at all. For example, if a patent
866
+ license would not permit royalty-free redistribution of the Program by
867
+ all those who receive copies directly or indirectly through you, then
868
+ the only way you could satisfy both it and this License would be to
869
+ refrain entirely from distribution of the Program.
870
+
871
+ If any portion of this section is held invalid or unenforceable under
872
+ any particular circumstance, the balance of the section is intended to
873
+ apply and the section as a whole is intended to apply in other
874
+ circumstances.
875
+
876
+ It is not the purpose of this section to induce you to infringe any
877
+ patents or other property right claims or to contest validity of any
878
+ such claims; this section has the sole purpose of protecting the
879
+ integrity of the free software distribution system, which is
880
+ implemented by public license practices. Many people have made
881
+ generous contributions to the wide range of software distributed
882
+ through that system in reliance on consistent application of that
883
+ system; it is up to the author/donor to decide if he or she is willing
884
+ to distribute software through any other system and a licensee cannot
885
+ impose that choice.
886
+
887
+ This section is intended to make thoroughly clear what is believed to
888
+ be a consequence of the rest of this License.
889
+
890
+ 8. If the distribution and/or use of the Program is restricted in
891
+ certain countries either by patents or by copyrighted interfaces, the
892
+ original copyright holder who places the Program under this License
893
+ may add an explicit geographical distribution limitation excluding
894
+ those countries, so that distribution is permitted only in or among
895
+ countries not thus excluded. In such case, this License incorporates
896
+ the limitation as if written in the body of this License.
897
+
898
+ 9. The Free Software Foundation may publish revised and/or new versions
899
+ of the General Public License from time to time. Such new versions will
900
+ be similar in spirit to the present version, but may differ in detail to
901
+ address new problems or concerns.
902
+
903
+ Each version is given a distinguishing version number. If the Program
904
+ specifies a version number of this License which applies to it and "any
905
+ later version", you have the option of following the terms and conditions
906
+ either of that version or of any later version published by the Free
907
+ Software Foundation. If the Program does not specify a version number of
908
+ this License, you may choose any version ever published by the Free Software
909
+ Foundation.
910
+
911
+ 10. If you wish to incorporate parts of the Program into other free
912
+ programs whose distribution conditions are different, write to the author
913
+ to ask for permission. For software which is copyrighted by the Free
914
+ Software Foundation, write to the Free Software Foundation; we sometimes
915
+ make exceptions for this. Our decision will be guided by the two goals
916
+ of preserving the free status of all derivatives of our free software and
917
+ of promoting the sharing and reuse of software generally.
918
+
919
+ NO WARRANTY
920
+
921
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
922
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
923
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
924
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
925
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
926
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
927
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
928
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
929
+ REPAIR OR CORRECTION.
930
+
931
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
932
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
933
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
934
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
935
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
936
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
937
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
938
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
939
+ POSSIBILITY OF SUCH DAMAGES.
940
+
941
+ END OF TERMS AND CONDITIONS
942
+
943
+ ------
944
+
945
+ ** six; version 1.14.0 -- https://github.com/benjaminp/six/tree/1.14.0
946
+ Copyright (c) 2010-2020 Benjamin Peterson
947
+
948
+ Copyright (c) 2010-2020 Benjamin Peterson
949
+
950
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
951
+ this software and associated documentation files (the "Software"), to deal in
952
+ the Software without restriction, including without limitation the rights to
953
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
954
+ of
955
+ the Software, and to permit persons to whom the Software is furnished to do so,
956
+ subject to the following conditions:
957
+
958
+ The above copyright notice and this permission notice shall be included in all
959
+ copies or substantial portions of the Software.
960
+
961
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
962
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
963
+ FITNESS
964
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
965
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
966
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
967
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
968
+
969
+ ------
970
+
971
+ ** urllib3; version 1.25.8 -- https://github.com/urllib3/urllib3/tree/1.25.8
972
+ Copyright (c) 2008-2019 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
973
+
974
+ MIT License
975
+
976
+ Copyright (c) 2008-2019 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
977
+
978
+ Permission is hereby granted, free of charge, to any person obtaining a copy
979
+ of this software and associated documentation files (the "Software"), to deal
980
+ in the Software without restriction, including without limitation the rights
981
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
982
+ copies of the Software, and to permit persons to whom the Software is
983
+ furnished to do so, subject to the following conditions:
984
+
985
+ The above copyright notice and this permission notice shall be included in all
986
+ copies or substantial portions of the Software.
987
+
988
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
989
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
990
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
991
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
992
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
993
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
994
+ SOFTWARE.
995
+
996
+ ------
997
+
998
+ ** setuptools; version 45.2.0 --
999
+ https://github.com/pypa/setuptools/tree/v45.2.0
1000
+ Copyright (C) 2016 Jason R Coombs <[email protected]>
1001
+
1002
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
1003
+ this software and associated documentation files (the "Software"), to deal in
1004
+ the Software without restriction, including without limitation the rights to
1005
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1006
+ of the Software, and to permit persons to whom the Software is furnished to do
1007
+ so, subject to the following conditions:
1008
+
1009
+ The above copyright notice and this permission notice shall be included in all
1010
+ copies or substantial portions of the Software.
1011
+
1012
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1013
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1014
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1015
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1016
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1017
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1018
+ SOFTWARE.
1019
+
1020
+ ------
1021
+
1022
+ ** wcwidth; version 0.1.8 -- https://github.com/jquast/wcwidth/tree/0.1.8
1023
+ Copyright (c) 2014 Jeff Quast <[email protected]>
1024
+
1025
+ The MIT License (MIT)
1026
+
1027
+ Copyright (c) 2014 Jeff Quast <[email protected]>
1028
+
1029
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1030
+ of this software and associated documentation files (the "Software"), to deal
1031
+ in the Software without restriction, including without limitation the rights
1032
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1033
+ copies of the Software, and to permit persons to whom the Software is
1034
+ furnished to do so, subject to the following conditions:
1035
+
1036
+ The above copyright notice and this permission notice shall be included in all
1037
+ copies or substantial portions of the Software.
1038
+
1039
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1040
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1041
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1042
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1043
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1044
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1045
+ SOFTWARE.
1046
+
1047
+ ------
1048
+
1049
+ ** cffi; version 1.14.0 --
1050
+ https://foss.heptapod.net/pypy/cffi/tree/branch/release-1.14
1051
+ © Copyright 2012-2018, Armin Rigo, Maciej Fijalkowski
1052
+
1053
+ Except when otherwise stated (look for LICENSE files in directories or
1054
+ information at the beginning of each file) all software and
1055
+ documentation is licensed as follows:
1056
+
1057
+ The MIT License
1058
+
1059
+ Permission is hereby granted, free of charge, to any person
1060
+ obtaining a copy of this software and associated documentation
1061
+ files (the "Software"), to deal in the Software without
1062
+ restriction, including without limitation the rights to use,
1063
+ copy, modify, merge, publish, distribute, sublicense, and/or
1064
+ sell copies of the Software, and to permit persons to whom the
1065
+ Software is furnished to do so, subject to the following conditions:
1066
+
1067
+ The above copyright notice and this permission notice shall be included
1068
+ in all copies or substantial portions of the Software.
1069
+
1070
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1071
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1072
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1073
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1074
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1075
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1076
+ DEALINGS IN THE SOFTWARE.
1077
+
1078
+ ------
1079
+
1080
+ ** jmespath; version 0.9.4 --
1081
+ https://github.com/jmespath/jmespath.py/tree/0.9.4
1082
+ Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
1083
+
1084
+ Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
1085
+
1086
+ Permission is hereby granted, free of charge, to any person obtaining a
1087
+ copy of this software and associated documentation files (the
1088
+ "Software"), to deal in the Software without restriction, including
1089
+ without limitation the rights to use, copy, modify, merge, publish, dis-
1090
+ tribute, sublicense, and/or sell copies of the Software, and to permit
1091
+ persons to whom the Software is furnished to do so, subject to the fol-
1092
+ lowing conditions:
1093
+
1094
+ The above copyright notice and this permission notice shall be included
1095
+ in all copies or substantial portions of the Software.
1096
+
1097
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1098
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
1099
+ ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
1100
+ SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
1101
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1102
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1103
+ IN THE SOFTWARE.
1104
+
1105
+ ------
1106
+
1107
+ ** ruamel.yaml; version 0.15.100 --
1108
+ https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/
1109
+ Copyright (c) 2014-2019 Anthon van der Neut, Ruamel bvba
1110
+
1111
+ The MIT License (MIT)
1112
+
1113
+ Copyright (c) 2014-2020 Anthon van der Neut, Ruamel bvba
1114
+
1115
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1116
+ of this software and associated documentation files (the "Software"), to deal
1117
+ in the Software without restriction, including without limitation the rights
1118
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1119
+ copies of the Software, and to permit persons to whom the Software is
1120
+ furnished to do so, subject to the following conditions:
1121
+
1122
+ The above copyright notice and this permission notice shall be included in
1123
+ all copies or substantial portions of the Software.
1124
+
1125
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1126
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1127
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1128
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1129
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1130
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1131
+ SOFTWARE.
1132
+
1133
+ ------
1134
+
1135
+ ** OpenSSL; version 1.0.2s --
1136
+ https://github.com/openssl/openssl/tree/OpenSSL_1_0_1s
1137
+ Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
1138
+ Copyright (C) 1995-1998 Eric Young ([email protected])
1139
+
1140
+ LICENSE ISSUES
1141
+ ==============
1142
+
1143
+ The OpenSSL toolkit stays under a double license, i.e. both the conditions of
1144
+ the OpenSSL License and the original SSLeay license apply to the toolkit.
1145
+ See below for the actual license texts.
1146
+
1147
+ OpenSSL License
1148
+ ---------------
1149
+
1150
+ /* ====================================================================
1151
+ * Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved.
1152
+ *
1153
+ * Redistribution and use in source and binary forms, with or without
1154
+ * modification, are permitted provided that the following conditions
1155
+ * are met:
1156
+ *
1157
+ * 1. Redistributions of source code must retain the above copyright
1158
+ * notice, this list of conditions and the following disclaimer.
1159
+ *
1160
+ * 2. Redistributions in binary form must reproduce the above copyright
1161
+ * notice, this list of conditions and the following disclaimer in
1162
+ * the documentation and/or other materials provided with the
1163
+ * distribution.
1164
+ *
1165
+ * 3. All advertising materials mentioning features or use of this
1166
+ * software must display the following acknowledgment:
1167
+ * "This product includes software developed by the OpenSSL Project
1168
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
1169
+ *
1170
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
1171
+ * endorse or promote products derived from this software without
1172
+ * prior written permission. For written permission, please contact
1173
1174
+ *
1175
+ * 5. Products derived from this software may not be called "OpenSSL"
1176
+ * nor may "OpenSSL" appear in their names without prior written
1177
+ * permission of the OpenSSL Project.
1178
+ *
1179
+ * 6. Redistributions of any form whatsoever must retain the following
1180
+ * acknowledgment:
1181
+ * "This product includes software developed by the OpenSSL Project
1182
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
1183
+ *
1184
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
1185
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1186
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1187
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
1188
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1189
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1190
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1191
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1192
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1193
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1194
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
1195
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
1196
+ * ====================================================================
1197
+ *
1198
+ * This product includes cryptographic software written by Eric Young
1199
+ * ([email protected]). This product includes software written by Tim
1200
+ * Hudson ([email protected]).
1201
+ *
1202
+ */
1203
+
1204
+ Original SSLeay License
1205
+ -----------------------
1206
+
1207
+ /* Copyright (C) 1995-1998 Eric Young ([email protected])
1208
+ * All rights reserved.
1209
+ *
1210
+ * This package is an SSL implementation written
1211
+ * by Eric Young ([email protected]).
1212
+ * The implementation was written so as to conform with Netscapes SSL.
1213
+ *
1214
+ * This library is free for commercial and non-commercial use as long as
1215
+ * the following conditions are aheared to. The following conditions
1216
+ * apply to all code found in this distribution, be it the RC4, RSA,
1217
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
1218
+ * included with this distribution is covered by the same copyright terms
1219
+ * except that the holder is Tim Hudson ([email protected]).
1220
+ *
1221
+ * Copyright remains Eric Young's, and as such any Copyright notices in
1222
+ * the code are not to be removed.
1223
+ * If this package is used in a product, Eric Young should be given attribution
1224
+ * as the author of the parts of the library used.
1225
+ * This can be in the form of a textual message at program startup or
1226
+ * in documentation (online or textual) provided with the package.
1227
+ *
1228
+ * Redistribution and use in source and binary forms, with or without
1229
+ * modification, are permitted provided that the following conditions
1230
+ * are met:
1231
+ * 1. Redistributions of source code must retain the copyright
1232
+ * notice, this list of conditions and the following disclaimer.
1233
+ * 2. Redistributions in binary form must reproduce the above copyright
1234
+ * notice, this list of conditions and the following disclaimer in the
1235
+ * documentation and/or other materials provided with the distribution.
1236
+ * 3. All advertising materials mentioning features or use of this software
1237
+ * must display the following acknowledgement:
1238
+ * "This product includes cryptographic software written by
1239
+ * Eric Young ([email protected])"
1240
+ * The word 'cryptographic' can be left out if the rouines from the library
1241
+ * being used are not cryptographic related :-).
1242
+ * 4. If you include any Windows specific code (or a derivative thereof) from
1243
+ * the apps directory (application code) you must include an acknowledgement:
1244
+ * "This product includes software written by Tim Hudson ([email protected])"
1245
+ *
1246
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
1247
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1248
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1249
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1250
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1251
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1252
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1253
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1254
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1255
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1256
+ * SUCH DAMAGE.
1257
+ *
1258
+ * The licence and distribution terms for any publically available version or
1259
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
1260
+ * copied and put under another distribution licence
1261
+ * [including the GNU Public Licence.]
1262
+ */
1263
+
1264
+ ------
1265
+
1266
+ ** Python 3.9.11; version 3.9.11 -- https://github.com/python/cpython/tree/v3.9.11
1267
+ Copyright © 2001-2020 Python Software Foundation. All rights reserved.
1268
+
1269
+ PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
1270
+ --------------------------------------------
1271
+
1272
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
1273
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
1274
+ otherwise using this software ("Python") in source or binary form and
1275
+ its associated documentation.
1276
+
1277
+ 2. Subject to the terms and conditions of this License Agreement, PSF hereby
1278
+ grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
1279
+ analyze, test, perform and/or display publicly, prepare derivative works,
1280
+ distribute, and otherwise use Python alone or in any derivative version,
1281
+ provided, however, that PSF's License Agreement and PSF's notice of copyright,
1282
+ i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
1283
+ 2010,
1284
+ 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software
1285
+ Foundation;
1286
+ All Rights Reserved" are retained in Python alone or in any derivative version
1287
+ prepared by Licensee.
1288
+
1289
+ 3. In the event Licensee prepares a derivative work that is based on
1290
+ or incorporates Python or any part thereof, and wants to make
1291
+ the derivative work available to others as provided herein, then
1292
+ Licensee hereby agrees to include in any such work a brief summary of
1293
+ the changes made to Python.
1294
+
1295
+ 4. PSF is making Python available to Licensee on an "AS IS"
1296
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
1297
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
1298
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
1299
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
1300
+ INFRINGE ANY THIRD PARTY RIGHTS.
1301
+
1302
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
1303
+ FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
1304
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
1305
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
1306
+
1307
+ 6. This License Agreement will automatically terminate upon a material
1308
+ breach of its terms and conditions.
1309
+
1310
+ 7. Nothing in this License Agreement shall be deemed to create any
1311
+ relationship of agency, partnership, or joint venture between PSF and
1312
+ Licensee. This License Agreement does not grant permission to use PSF
1313
+ trademarks or trade name in a trademark sense to endorse or promote
1314
+ products or services of Licensee, or any third party.
1315
+
1316
+ 8. By copying, installing or otherwise using Python, Licensee
1317
+ agrees to be bound by the terms and conditions of this License
1318
+ Agreement.
1319
+
1320
+
1321
+
1322
+ ------
1323
+
1324
+ ** docutils; version 0.15.2 --
1325
+ https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/
1326
+ :Author: David Goodger
1327
+ :Contact: [email protected]
1328
+ :Date: $Date: 2015-05-08 15:56:32 +0000 (Fri, 08 May 2015) $
1329
+ :Web site: http://docutils.sourceforge.net/
1330
+ :Copyright: This document has been placed in the public domain.
1331
+
1332
+ ==================
1333
+ Copying Docutils
1334
+ ==================
1335
+
1336
+ :Author: David Goodger
1337
+ :Contact: [email protected]
1338
+ :Date: $Date: 2015-05-08 15:56:32 +0000 (Fri, 08 May 2015) $
1339
+ :Web site: http://docutils.sourceforge.net/
1340
+ :Copyright: This document has been placed in the public domain.
1341
+
1342
+ Most of the files included in this project have been placed in the
1343
+ public domain, and therefore have no license requirements and no
1344
+ restrictions on copying or usage; see the `Public Domain Dedication`_
1345
+ below. There are a few exceptions_, listed below.
1346
+ Files in the Sandbox_ are not distributed with Docutils releases and
1347
+ may have different license terms.
1348
+
1349
+
1350
+ Public Domain Dedication
1351
+ ========================
1352
+
1353
+ The persons who have associated their work with this project (the
1354
+ "Dedicator": David Goodger and the many contributors to the Docutils
1355
+ project) hereby dedicate the entire copyright, less the exceptions_
1356
+ listed below, in the work of authorship known as "Docutils" identified
1357
+ below (the "Work") to the public domain.
1358
+
1359
+ The primary repository for the Work is the Internet World Wide Web
1360
+ site <http://docutils.sourceforge.net/>. The Work consists of the
1361
+ files within the "docutils" module of the Docutils project Subversion
1362
+ repository (Internet host docutils.svn.sourceforge.net, filesystem path
1363
+ /svnroot/docutils), whose Internet web interface is located at
1364
+ <http://docutils.svn.sourceforge.net/viewvc/docutils/>. Files dedicated to the
1365
+ public domain may be identified by the inclusion, near the beginning
1366
+ of each file, of a declaration of the form::
1367
+
1368
+ Copyright: This document/module/DTD/stylesheet/file/etc. has been
1369
+ placed in the public domain.
1370
+
1371
+ Dedicator makes this dedication for the benefit of the public at large
1372
+ and to the detriment of Dedicator's heirs and successors. Dedicator
1373
+ intends this dedication to be an overt act of relinquishment in
1374
+ perpetuity of all present and future rights under copyright law,
1375
+ whether vested or contingent, in the Work. Dedicator understands that
1376
+ such relinquishment of all rights includes the relinquishment of all
1377
+ rights to enforce (by lawsuit or otherwise) those copyrights in the
1378
+ Work.
1379
+
1380
+ Dedicator recognizes that, once placed in the public domain, the Work
1381
+ may be freely reproduced, distributed, transmitted, used, modified,
1382
+ built upon, or otherwise exploited by anyone for any purpose,
1383
+ commercial or non-commercial, and in any way, including by methods
1384
+ that have not yet been invented or conceived.
1385
+
1386
+ (This dedication is derived from the text of the `Creative Commons
1387
+ Public Domain Dedication`. [#]_)
1388
+
1389
+ .. [#] Creative Commons has `retired this legal tool`__ and does not
1390
+ recommend that it be applied to works: This tool is based on United
1391
+ States law and may not be applicable outside the US. For dedicating new
1392
+ works to the public domain, Creative Commons recommend the replacement
1393
+ Public Domain Dedication CC0_ (CC zero, "No Rights Reserved"). So does
1394
+ the Free Software Foundation in its license-list_.
1395
+
1396
+ __ http://creativecommons.org/retiredlicenses
1397
+ .. _CC0: http://creativecommons.org/about/cc0
1398
+
1399
+ Exceptions
1400
+ ==========
1401
+
1402
+ The exceptions to the `Public Domain Dedication`_ above are:
1403
+
1404
+ * docutils/writers/s5_html/themes/default/iepngfix.htc:
1405
+
1406
+ IE5.5+ PNG Alpha Fix v1.0 by Angus Turnbull
1407
+ <http://www.twinhelix.com>. Free usage permitted as long as
1408
+ this notice remains intact.
1409
+
1410
+ * docutils/utils/math/__init__.py,
1411
+ docutils/utils/math/latex2mathml.py,
1412
+ docutils/writers/xetex/__init__.py,
1413
+ docutils/writers/latex2e/docutils-05-compat.sty,
1414
+ docs/user/docutils-05-compat.sty.txt,
1415
+ docutils/utils/error_reporting.py,
1416
+ docutils/test/transforms/test_smartquotes.py:
1417
+
1418
+ Copyright © Günter Milde.
1419
+ Released under the terms of the `2-Clause BSD license`_
1420
+ (`local copy <licenses/BSD-2-Clause.txt>`__).
1421
+
1422
+ * docutils/utils/smartquotes.py
1423
+
1424
+ Copyright © 2011 Günter Milde,
1425
+ based on `SmartyPants`_ © 2003 John Gruber
1426
+ (released under a 3-Clause BSD license included in the file)
1427
+ and smartypants.py © 2004, 2007 Chad Miller.
1428
+ Released under the terms of the `2-Clause BSD license`_
1429
+ (`local copy <licenses/BSD-2-Clause.txt>`__).
1430
+
1431
+ .. _SmartyPants: http://daringfireball.net/projects/smartypants/
1432
+
1433
+ * docutils/utils/math/math2html.py,
1434
+ docutils/writers/html4css1/math.css
1435
+
1436
+ Copyright © Alex Fernández
1437
+ These files are part of eLyXer_, released under the `GNU
1438
+ General Public License`_ version 3 or later. The author relicensed
1439
+ them for Docutils under the terms of the `2-Clause BSD license`_
1440
+ (`local copy <licenses/BSD-2-Clause.txt>`__).
1441
+
1442
+ .. _eLyXer: http://www.nongnu.org/elyxer/
1443
+
1444
+ * docutils/utils/roman.py, copyright by Mark Pilgrim, released under the
1445
+ `Python 2.1.1 license`_ (`local copy`__).
1446
+
1447
+ __ licenses/python-2-1-1.txt
1448
+
1449
+ * tools/editors/emacs/rst.el, copyright by Free Software Foundation,
1450
+ Inc., released under the `GNU General Public License`_ version 3 or
1451
+ later (`local copy`__).
1452
+
1453
+ __ licenses/gpl-3-0.txt
1454
+
1455
+ The `2-Clause BSD license`_ and the Python licenses are OSI-approved_
1456
+ and GPL-compatible_.
1457
+
1458
+ Plaintext versions of all the linked-to licenses are provided in the
1459
+ licenses_ directory.
1460
+
1461
+ .. _sandbox: http://docutils.sourceforge.net/sandbox/README.html
1462
+ .. _licenses: licenses/
1463
+ .. _Python 2.1.1 license: http://www.python.org/2.1.1/license.html
1464
+ .. _GNU General Public License: http://www.gnu.org/copyleft/gpl.html
1465
+ .. _2-Clause BSD license: http://www.spdx.org/licenses/BSD-2-Clause
1466
+ .. _OSI-approved: http://opensource.org/licenses/
1467
+ .. _license-list:
1468
+ .. _GPL-compatible: http://www.gnu.org/licenses/license-list.html
aws/install ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ # Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://aws.amazon.com/apache2.0/
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ usage() {
16
+ cat 1>&2 <<EOF
17
+ Installs the AWS CLI v2
18
+
19
+ USAGE:
20
+ install [FLAGS] [OPTIONS]
21
+
22
+ FLAGS:
23
+ -u, --update Updates the AWS CLI v2 if a different version
24
+ is previously installed. By default, this script
25
+ will not update the AWS CLI if a previous
26
+ installation is detected.
27
+
28
+ -h, --help Prints help information
29
+
30
+ OPTIONS:
31
+ -i, --install-dir <path> The directory to install the AWS CLI v2. By
32
+ default, this directory is: /usr/local/aws-cli
33
+
34
+ -b, --bin-dir <path> The directory to store symlinks to executables
35
+ for the AWS CLI v2. By default, the directory
36
+ used is: /usr/local/bin
37
+ EOF
38
+ }
39
+
40
+ parse_commandline() {
41
+ while test $# -gt 0
42
+ do
43
+ key="$1"
44
+ case "$key" in
45
+ -i|--install-dir)
46
+ PARSED_INSTALL_DIR="$2"
47
+ shift
48
+ ;;
49
+ -b|--bin-dir)
50
+ PARSED_BIN_DIR="$2"
51
+ shift
52
+ ;;
53
+ -u|--update)
54
+ PARSED_UPGRADE="yes"
55
+ ;;
56
+ -h|--help)
57
+ usage
58
+ exit 0
59
+ ;;
60
+ *)
61
+ die "Got an unexpected argument: $1"
62
+ ;;
63
+ esac
64
+ shift
65
+ done
66
+ }
67
+
68
+ set_global_vars() {
69
+ ROOT_INSTALL_DIR=${PARSED_INSTALL_DIR:-/usr/local/aws-cli}
70
+ BIN_DIR=${PARSED_BIN_DIR:-/usr/local/bin}
71
+ UPGRADE=${PARSED_UPGRADE:-no}
72
+
73
+ EXE_NAME="aws"
74
+ COMPLETER_EXE_NAME="aws_completer"
75
+ INSTALLER_DIR="$( cd "$( dirname "$0" )" >/dev/null 2>&1 && pwd )"
76
+ INSTALLER_DIST_DIR="$INSTALLER_DIR/dist"
77
+ INSTALLER_EXE="$INSTALLER_DIST_DIR/$EXE_NAME"
78
+ AWS_EXE_VERSION=$($INSTALLER_EXE --version | cut -d ' ' -f 1 | cut -d '/' -f 2)
79
+
80
+ INSTALL_DIR="$ROOT_INSTALL_DIR/v2/$AWS_EXE_VERSION"
81
+ INSTALL_DIR="$INSTALL_DIR"
82
+ INSTALL_DIST_DIR="$INSTALL_DIR/dist"
83
+ INSTALL_BIN_DIR="$INSTALL_DIR/bin"
84
+ INSTALL_AWS_EXE="$INSTALL_BIN_DIR/$EXE_NAME"
85
+ INSTALL_AWS_COMPLETER_EXE="$INSTALL_BIN_DIR/$COMPLETER_EXE_NAME"
86
+
87
+ CURRENT_INSTALL_DIR="$ROOT_INSTALL_DIR/v2/current"
88
+ CURRENT_AWS_EXE="$CURRENT_INSTALL_DIR/bin/$EXE_NAME"
89
+ CURRENT_AWS_COMPLETER_EXE="$CURRENT_INSTALL_DIR/bin/$COMPLETER_EXE_NAME"
90
+
91
+ BIN_AWS_EXE="$BIN_DIR/$EXE_NAME"
92
+ BIN_AWS_COMPLETER_EXE="$BIN_DIR/$COMPLETER_EXE_NAME"
93
+ }
94
+
95
+ create_install_dir() {
96
+ mkdir -p "$INSTALL_DIR" || exit 1
97
+ {
98
+ setup_install_dist &&
99
+ setup_install_bin &&
100
+ create_current_symlink
101
+ } || {
102
+ rm -rf "$INSTALL_DIR"
103
+ exit 1
104
+ }
105
+ }
106
+
107
+ check_preexisting_install() {
108
+ if [ -L "$CURRENT_INSTALL_DIR" ] && [ "$UPGRADE" = "no" ]
109
+ then
110
+ die "Found preexisting AWS CLI installation: $CURRENT_INSTALL_DIR. Please rerun install script with --update flag."
111
+ fi
112
+ if [ -d "$INSTALL_DIR" ]
113
+ then
114
+ echo "Found same AWS CLI version: $INSTALL_DIR. Skipping install."
115
+ exit 0
116
+ fi
117
+ }
118
+
119
+ setup_install_dist() {
120
+ cp -r "$INSTALLER_DIST_DIR" "$INSTALL_DIST_DIR"
121
+ }
122
+
123
+ setup_install_bin() {
124
+ mkdir -p "$INSTALL_BIN_DIR"
125
+ ln -s "../dist/$EXE_NAME" "$INSTALL_AWS_EXE"
126
+ ln -s "../dist/$COMPLETER_EXE_NAME" "$INSTALL_AWS_COMPLETER_EXE"
127
+ }
128
+
129
+ create_current_symlink() {
130
+ ln -snf "$INSTALL_DIR" "$CURRENT_INSTALL_DIR"
131
+ }
132
+
133
+ create_bin_symlinks() {
134
+ mkdir -p "$BIN_DIR"
135
+ ln -sf "$CURRENT_AWS_EXE" "$BIN_AWS_EXE"
136
+ ln -sf "$CURRENT_AWS_COMPLETER_EXE" "$BIN_AWS_COMPLETER_EXE"
137
+ }
138
+
139
+ die() {
140
+ err_msg="$1"
141
+ echo "$err_msg" >&2
142
+ exit 1
143
+ }
144
+
145
+ main() {
146
+ parse_commandline "$@"
147
+ set_global_vars
148
+ check_preexisting_install
149
+ create_install_dir
150
+ create_bin_symlinks
151
+ echo "You can now run: $BIN_AWS_EXE --version"
152
+ exit 0
153
+ }
154
+
155
+ main "$@" || exit 1
awscliv2.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41ced963f9c2193fe875d7b21c5873980cc482ae7f054e5db9a7f66b11069624
3
+ size 66108930
pyproject.toml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "videollama2"
7
+ version = "1.0"
8
+ description = "Release of VideoLLaMA2"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ classifiers = [
12
+ "Programming Language :: Python :: 3",
13
+ "License :: OSI Approved :: Apache Software License",
14
+ ]
15
+ dependencies = [
16
+ "torch==2.2.0", "torchvision==0.17.0",
17
+ "transformers==4.40.0", "tokenizers==0.19.1",
18
+ "deepspeed==0.13.1", "accelerate==0.26.1",
19
+ "peft==0.4.0", "timm==1.0.3", "numpy==1.24.4",
20
+ "decord==0.6.0", "imageio==2.34.0", "imageio-ffmpeg==0.4.9",
21
+ "moviepy==1.0.3", "scenedetect==0.6.3",
22
+ "opencv-python==4.6.0.66", "pysubs2",
23
+ "scikit-learn==1.2.2", "huggingface_hub==0.23.4", "sentencepiece==0.1.99",
24
+ "shortuuid", "einops==0.6.1", "einops-exts==0.0.4",
25
+ "bitsandbytes==0.43.0", "pydantic>=2.0", "markdown2[all]",
26
+ "gradio==3.50.0", "gradio_client==0.6.1", "httpx==0.24.1",
27
+ "requests", "openai", "uvicorn", "fastapi", "tensorboard", "wandb", "tabulate"
28
+ ]
29
+
30
+ [project.optional-dependencies]
31
+ train = ["ninja"]
32
+
33
+ [project.urls]
34
+ "Homepage" = "https://github.com/DAMO-NLP-SG/VideoLLaMA2"
35
+ "Bug Tracker" = "https://github.com/DAMO-NLP-SG/VideoLLaMA2/issues"
36
+
37
+ [tool.setuptools.packages.find]
38
+ exclude = ["assets*", "benchmark*", "docs", "dist*", "playground*", "scripts*", "tests*"]
39
+
40
+ [tool.wheel]
41
+ exclude = ["assets*", "benchmark*", "docs", "dist*", "playground*", "scripts*", "tests*"]
requirements.txt ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --extra-index-url https://download.pytorch.org/whl/cu118
2
+ # basic dependencies
3
+ torch==2.2.0
4
+ torchvision==0.17.0
5
+ transformers==4.40.0
6
+ tokenizers==0.19.1
7
+ deepspeed==0.13.1
8
+ accelerate==0.26.1
9
+ peft==0.4.0
10
+ timm==1.0.3
11
+ numpy==1.24.4
12
+ # data processing
13
+ decord==0.6.0
14
+ imageio==2.34.0
15
+ imageio-ffmpeg==0.4.9
16
+ moviepy==1.0.3
17
+ scenedetect==0.6.3
18
+ opencv-python==4.6.0.66
19
+ pysubs2
20
+ # misc
21
+ scikit-learn==1.2.2
22
+ huggingface_hub==0.23.4
23
+ sentencepiece==0.1.99
24
+ shortuuid
25
+ einops==0.6.1
26
+ einops-exts==0.0.4
27
+ bitsandbytes==0.43.0
28
+ pydantic>=2.0
29
+ markdown2[all]
30
+ gradio==3.50.0
31
+ gradio_client==0.6.1
32
+ httpx==0.24.1
33
+ requests
34
+ openai
35
+ uvicorn
36
+ fastapi
37
+ tensorboard
38
+ wandb
39
+ tabulate
40
+ spaces==0.29.2
scripts/custom/finetune.sh ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=128
26
+ LOCAL_BATCH_SIZE=4
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+
29
+ # Log Arguments
30
+ export TRANSFORMERS_OFFLINE=1
31
+ export WANDB_PROJECT=videollama2
32
+ RUN_NAME=downstream_sft_settings
33
+ DATA_DIR=datasets
34
+ OUTP_DIR=work_dirs
35
+
36
+ torchrun --nnodes $WORLD_SIZE \
37
+ --nproc_per_node $NPROC_PER_NODE \
38
+ --master_addr=$MASTER_ADDR \
39
+ --master_port=$MASTER_PORT \
40
+ --node_rank $RANK \
41
+ videollama2/train_flash_attn.py \
42
+ --deepspeed scripts/zero3.json \
43
+ --model_type videollama2 \
44
+ --model_path mistralai/Mistral-7B-Instruct-v0.2 \
45
+ --vision_tower openai/clip-vit-large-patch14-336 \
46
+ --mm_projector_type stc_connector \
47
+ --pretrain_mm_mlp_adapter DAMO-NLP-SG/VideoLLaMA2-7B-Base/mm_projector.bin \
48
+ --data_path ${DATA_DIR}/videollava_sft/videochatgpt_llavaimage_tune.json \
49
+ --data_folder ${DATA_DIR}/videollava_sft/ \
50
+ --mm_vision_select_layer -2 \
51
+ --image_aspect_ratio pad \
52
+ --num_frames 8 \
53
+ --bf16 True \
54
+ --tf32 True \
55
+ --fp16 False \
56
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/finetune_${RUN_NAME} \
57
+ --num_train_epochs 1 \
58
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
59
+ --per_device_eval_batch_size 4 \
60
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
61
+ --evaluation_strategy "no" \
62
+ --save_strategy "steps" \
63
+ --save_steps 500 \
64
+ --save_total_limit 99 \
65
+ --learning_rate 2e-5 \
66
+ --weight_decay 0. \
67
+ --warmup_ratio 0.03 \
68
+ --lr_scheduler_type "cosine" \
69
+ --logging_steps 1 \
70
+ --model_max_length 2048 \
71
+ --gradient_checkpointing True \
72
+ --dataloader_num_workers 4 \
73
+ --report_to tensorboard \
74
+ --run_name $RUN_NAME \
scripts/custom/finetune_lora.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=128
26
+ LOCAL_BATCH_SIZE=4
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+
29
+ # Log Arguments
30
+ export TRANSFORMERS_OFFLINE=1
31
+ export WANDB_PROJECT=videollama2
32
+ RUN_NAME=downstream_sft_settings_lora
33
+ DATA_DIR=datasets
34
+ OUTP_DIR=work_dirs
35
+
36
+ torchrun --nnodes $WORLD_SIZE \
37
+ --nproc_per_node $NPROC_PER_NODE \
38
+ --master_addr=$MASTER_ADDR \
39
+ --master_port=$MASTER_PORT \
40
+ --node_rank $RANK \
41
+ videollama2/train_flash_attn.py \
42
+ --lora_enable True --lora_r 128 --lora_alpha 256 --mm_projector_lr 2e-5 \
43
+ --deepspeed scripts/zero3.json \
44
+ --model_type videollama2 \
45
+ --model_path mistralai/Mistral-7B-Instruct-v0.2 \
46
+ --vision_tower openai/clip-vit-large-patch14-336 \
47
+ --mm_projector_type stc_connector \
48
+ --pretrain_mm_mlp_adapter DAMO-NLP-SG/VideoLLaMA2-7B-Base/mm_projector.bin \
49
+ --data_path ${DATA_DIR}/videollava_sft/videochatgpt_llavaimage_tune.json \
50
+ --data_folder ${DATA_DIR}/videollava_sft/ \
51
+ --mm_vision_select_layer -2 \
52
+ --image_aspect_ratio pad \
53
+ --num_frames 8 \
54
+ --bf16 True \
55
+ --tf32 True \
56
+ --fp16 False \
57
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/finetune_${RUN_NAME} \
58
+ --num_train_epochs 1 \
59
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
60
+ --per_device_eval_batch_size 4 \
61
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
62
+ --evaluation_strategy "no" \
63
+ --save_strategy "steps" \
64
+ --save_steps 500 \
65
+ --save_total_limit 99 \
66
+ --learning_rate 2e-5 \
67
+ --weight_decay 0. \
68
+ --warmup_ratio 0.03 \
69
+ --lr_scheduler_type "cosine" \
70
+ --logging_steps 1 \
71
+ --model_max_length 2048 \
72
+ --gradient_checkpointing True \
73
+ --dataloader_num_workers 4 \
74
+ --report_to tensorboard \
75
+ --run_name $RUN_NAME \
scripts/custom/finetune_qlora.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=128
26
+ LOCAL_BATCH_SIZE=4
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+
29
+ # Log Arguments
30
+ export TRANSFORMERS_OFFLINE=1
31
+ export WANDB_PROJECT=videollama2
32
+ RUN_NAME=downstream_sft_settings_qlora
33
+ DATA_DIR=datasets
34
+ OUTP_DIR=work_dirs
35
+
36
+ torchrun --nnodes $WORLD_SIZE \
37
+ --nproc_per_node $NPROC_PER_NODE \
38
+ --master_addr=$MASTER_ADDR \
39
+ --master_port=$MASTER_PORT \
40
+ --node_rank $RANK \
41
+ videollama2/train_flash_attn.py \
42
+ --lora_enable True --lora_r 128 --lora_alpha 256 --mm_projector_lr 2e-5 --bits 4 \
43
+ --deepspeed scripts/zero2.json \
44
+ --model_type videollama2 \
45
+ --model_path mistralai/Mistral-7B-Instruct-v0.2 \
46
+ --vision_tower openai/clip-vit-large-patch14-336 \
47
+ --mm_projector_type stc_connector \
48
+ --pretrain_mm_mlp_adapter DAMO-NLP-SG/VideoLLaMA2-7B-Base/mm_projector.bin \
49
+ --data_path ${DATA_DIR}/videollava_sft/videochatgpt_llavaimage_tune.json \
50
+ --data_folder ${DATA_DIR}/videollava_sft/ \
51
+ --mm_vision_select_layer -2 \
52
+ --image_aspect_ratio pad \
53
+ --num_frames 8 \
54
+ --bf16 True \
55
+ --tf32 True \
56
+ --fp16 False \
57
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/finetune_${RUN_NAME} \
58
+ --num_train_epochs 1 \
59
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
60
+ --per_device_eval_batch_size 4 \
61
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
62
+ --evaluation_strategy "no" \
63
+ --save_strategy "steps" \
64
+ --save_steps 500 \
65
+ --save_total_limit 99 \
66
+ --learning_rate 2e-5 \
67
+ --weight_decay 0. \
68
+ --warmup_ratio 0.03 \
69
+ --lr_scheduler_type "cosine" \
70
+ --logging_steps 1 \
71
+ --model_max_length 2048 \
72
+ --gradient_checkpointing True \
73
+ --dataloader_num_workers 4 \
74
+ --report_to tensorboard \
75
+ --run_name $RUN_NAME \
scripts/eval/eval_video_cap_msvc.sh ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/msvc/answers/${CKPT_NAME}/merge.json
16
+
17
+ # judge if the number of json lines is 0
18
+ if [ ! -f "$output_file" ] || [ $(cat "$output_file" | wc -l) -eq 0 ]; then
19
+ rm -f ${OUTPUT_DIR}/msvc/answers/${CKPT_NAME}/*.json
20
+ fi
21
+
22
+ if [ ! -f "$output_file" ]; then
23
+ for IDX in $(seq 0 $((CHUNKS-1))); do
24
+ # select the GPUs for the task
25
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
26
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_cap_msvc.py \
27
+ --model-path ${CKPT} \
28
+ --video-folder ${EVAL_DATA_DIR}/msvc \
29
+ --question-file ${EVAL_DATA_DIR}/msvc/msvc.json \
30
+ --output-file ${OUTPUT_DIR}/msvc/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
31
+ --num-chunks $CHUNKS \
32
+ --chunk-idx $IDX &
33
+ done
34
+
35
+ wait
36
+
37
+ # Clear out the output file if it exists.
38
+ > "$output_file"
39
+
40
+ #Loop through the indices and concatenate each file.
41
+ for IDX in $(seq 0 $((CHUNKS-1))); do
42
+ cat ${OUTPUT_DIR}/msvc/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
43
+ done
44
+ fi
45
+
46
+
47
+ AZURE_API_KEY=your_key
48
+ AZURE_API_ENDPOINT=your_endpoint
49
+ AZURE_API_DEPLOYNAME=your_deployname
50
+
51
+ python3 videollama2/eval/eval_video_cap_msvc_correctness.py \
52
+ --pred-path $output_file \
53
+ --output-dir ${OUTPUT_DIR}/msvc/answers/${CKPT_NAME}/correctness_gpt \
54
+ --output-json ${OUTPUT_DIR}/msvc/answers/${CKPT_NAME}/correctness_results.json \
55
+ --api-key $AZURE_API_KEY \
56
+ --api-endpoint $AZURE_API_ENDPOINT \
57
+ --api-deployname $AZURE_API_DEPLOYNAME \
58
+ --num-tasks 4 \
59
+
60
+ python3 videollama2/eval/eval_video_cap_msvc_detailedness.py \
61
+ --pred-path $output_file \
62
+ --output-dir ${OUTPUT_DIR}/msvc/answers/${CKPT_NAME}/detailedness_gpt \
63
+ --output-json ${OUTPUT_DIR}/msvc/answers/${CKPT_NAME}/detailedness_results.json \
64
+ --api-key $AZURE_API_KEY \
65
+ --api-endpoint $AZURE_API_ENDPOINT \
66
+ --api-deployname $AZURE_API_DEPLOYNAME \
67
+ --num-tasks 4 \
scripts/eval/eval_video_mcqa_egoschema.sh ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/egoschema/answers/${CKPT_NAME}/merge.csv
16
+
17
+ if [ ! -f "$output_file" ]; then
18
+ for IDX in $(seq 0 $((CHUNKS-1))); do
19
+ # select the GPUs for the task
20
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
21
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_mcqa_egoschema.py \
22
+ --model-path ${CKPT} \
23
+ --video-folder ${EVAL_DATA_DIR}/egoschema/good_clips_git \
24
+ --question-file ${EVAL_DATA_DIR}/egoschema/questions.json \
25
+ --answer-file ${OUTPUT_DIR}/egoschema/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.csv \
26
+ --num-chunks $CHUNKS \
27
+ --chunk-idx $IDX &
28
+ done
29
+
30
+ wait
31
+
32
+ # Clear out the output file if it exists.
33
+ > "$output_file"
34
+
35
+ echo 'q_uid, answer' >> "$output_file"
36
+
37
+ # Loop through the indices and concatenate each file.
38
+ for IDX in $(seq 0 $((CHUNKS-1))); do
39
+ cat ${OUTPUT_DIR}/egoschema/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.csv >> "$output_file"
40
+ done
41
+ fi
scripts/eval/eval_video_mcqa_mvbench.sh ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/mvbench/answers/${CKPT_NAME}/merge.json
16
+
17
+ # judge if the number of json lines is 0
18
+ if [ ! -f "$output_file" ] || [ $(cat "$output_file" | wc -l) -eq 0 ]; then
19
+ rm -f ${OUTPUT_DIR}/mvbench/answers/${CKPT_NAME}/*.json
20
+ fi
21
+
22
+ if [ ! -f "$output_file" ]; then
23
+ for IDX in $(seq 0 $((CHUNKS-1))); do
24
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
25
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_mcqa_mvbench.py \
26
+ --model-path ${CKPT} \
27
+ --video-folder ${EVAL_DATA_DIR}/mvbench/video \
28
+ --question-file ${EVAL_DATA_DIR}/mvbench/json \
29
+ --answer-file ${OUTPUT_DIR}/mvbench/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
30
+ --num-chunks $CHUNKS \
31
+ --chunk-idx $IDX &
32
+ done
33
+
34
+ wait
35
+
36
+ # Clear out the output file if it exists.
37
+ > "$output_file"
38
+
39
+ # Loop through the indices and concatenate each file.
40
+ for IDX in $(seq 0 $((CHUNKS-1))); do
41
+ cat ${OUTPUT_DIR}/mvbench/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
42
+ done
43
+ fi
44
+
45
+ python3 videollama2/eval/eval_video_mcqa_mvbench.py \
46
+ --pred_path ${output_file} \
scripts/eval/eval_video_mcqa_perception_test_mcqa.sh ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/perception_test_mcqa/answers/${CKPT_NAME}/merge.json
16
+
17
+ if [ ! -f "$output_file" ]; then
18
+ for IDX in $(seq 0 $((CHUNKS-1))); do
19
+ # select the GPUs for the task
20
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
21
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_mcqa_perception_test_mcqa.py \
22
+ --model-path ${CKPT} \
23
+ --video-folder ${EVAL_DATA_DIR}/perception_test_mcqa/videos \
24
+ --question-file ${EVAL_DATA_DIR}/perception_test_mcqa/mc_question_test.json \
25
+ --answer-file ${OUTPUT_DIR}/perception_test_mcqa/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
26
+ --num-chunks $CHUNKS \
27
+ --chunk-idx $IDX &
28
+ done
29
+
30
+ wait
31
+
32
+ # Clear out the output file if it exists.
33
+ > "$output_file"
34
+
35
+ echo "{" >> "$output_file"
36
+
37
+ # Loop through the indices and concatenate each file.
38
+ for IDX in $(seq 0 $((CHUNKS-1))); do
39
+ cat ${OUTPUT_DIR}/perception_test_mcqa/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
40
+ done
41
+
42
+ sed -i '$s/.$//' $output_file
43
+
44
+ echo "}" >> "$output_file"
45
+ fi
scripts/eval/eval_video_mcqa_videomme.sh ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B-16F
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/videomme/answers/${CKPT_NAME}/merge.json
16
+ output_sub_file=${OUTPUT_DIR}/videomme/answers/${CKPT_NAME}/merge_sub.json
17
+
18
+ # judge if the number of json lines is 0
19
+ if [ ! -f "$output_file" ] || [ $(cat "$output_file" | wc -l) -eq 0 ]; then
20
+ rm -f ${OUTPUT_DIR}/videomme/answers/${CKPT_NAME}/*.json
21
+ fi
22
+
23
+
24
+ if [ ! -f "$output_file" ]; then
25
+ for IDX in $(seq 0 $((CHUNKS-1))); do
26
+ # select the GPUs for the task
27
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
28
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_mcqa_videomme.py \
29
+ --model-path ${CKPT} \
30
+ --video-folder ${EVAL_DATA_DIR}/videomme/videos \
31
+ --subtitle-folder ${EVAL_DATA_DIR}/videomme/subtitles \
32
+ --question-file ${EVAL_DATA_DIR}/videomme/test-00000-of-00001.parquet \
33
+ --answer-file ${OUTPUT_DIR}/videomme/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
34
+ --num-chunks $CHUNKS \
35
+ --chunk-idx $IDX &
36
+ done
37
+
38
+ wait
39
+
40
+ # Clear out the output file if it exists.
41
+ > "$output_file"
42
+
43
+ echo "[" >> "$output_file"
44
+
45
+ #Loop through the indices and concatenate each file.
46
+ for IDX in $(seq 0 $((CHUNKS-1))); do
47
+ cat ${OUTPUT_DIR}/videomme/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
48
+ done
49
+
50
+ sed -i '$s/.$//' $output_file
51
+
52
+ echo "]" >> "$output_file"
53
+
54
+ # Clear out the output file if it exists.
55
+ > "$output_sub_file"
56
+
57
+ echo "[" >> "$output_sub_file"
58
+
59
+ #Loop through the indices and concatenate each file.
60
+ for IDX in $(seq 0 $((CHUNKS-1))); do
61
+ cat ${OUTPUT_DIR}/videomme/answers/${CKPT_NAME}/${CHUNKS}_${IDX}_sub.json >> "$output_sub_file"
62
+ done
63
+
64
+ sed -i '$s/.$//' $output_sub_file
65
+
66
+ echo "]" >> "$output_sub_file"
67
+ fi
68
+
69
+
70
+ python videollama2/eval/eval_video_mcqa_videomme.py \
71
+ --results_file $output_file \
72
+ --video_duration_type "short,medium,long" \
73
+ --return_categories_accuracy \
74
+ --return_sub_categories_accuracy \
75
+ --return_task_types_accuracy \
76
+ --skip_missing \
77
+
78
+ python videollama2/eval/eval_video_mcqa_videomme.py \
79
+ --results_file $output_sub_file \
80
+ --video_duration_type "short,medium,long" \
81
+ --return_categories_accuracy \
82
+ --return_sub_categories_accuracy \
83
+ --return_task_types_accuracy \
84
+ --skip_missing \
scripts/eval/eval_video_oqa_activitynet.sh ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ # CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT=work_dirs/videollama2gemma2/finetune_2b_vllama2
7
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
8
+
9
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
10
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
11
+
12
+ # divide data via the number of GPUs per task
13
+ GPUS_PER_TASK=1
14
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
15
+
16
+ output_file=${OUTPUT_DIR}/Activitynet_Zero_Shot_QA/answers/${CKPT_NAME}/merge.json
17
+
18
+ if [ ! -f "$output_file" ]; then
19
+ for IDX in $(seq 0 $((CHUNKS-1))); do
20
+ # select the GPUs for the task
21
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
22
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_oqa_activitynet.py \
23
+ --model-path ${CKPT} \
24
+ --video-folder ${EVAL_DATA_DIR}/Activitynet_Zero_Shot_QA/all_test \
25
+ --question-file ${EVAL_DATA_DIR}/Activitynet_Zero_Shot_QA/test_q.json \
26
+ --answer-file ${EVAL_DATA_DIR}/Activitynet_Zero_Shot_QA/test_a.json \
27
+ --output-file ${OUTPUT_DIR}/Activitynet_Zero_Shot_QA/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
28
+ --num-chunks $CHUNKS \
29
+ --chunk-idx $IDX &
30
+ done
31
+
32
+ wait
33
+
34
+ # Clear out the output file if it exists.
35
+ > "$output_file"
36
+
37
+ #Loop through the indices and concatenate each file.
38
+ for IDX in $(seq 0 $((CHUNKS-1))); do
39
+ cat ${OUTPUT_DIR}/Activitynet_Zero_Shot_QA/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
40
+ done
41
+ fi
42
+
43
+ AZURE_API_KEY=your_key
44
+ AZURE_API_ENDPOINT=your_endpoint
45
+ AZURE_API_DEPLOYNAME=your_deployname
46
+
47
+ python3 videollama2/eval/eval_video_oqa_activitynet.py \
48
+ --pred-path ${output_file} \
49
+ --output-dir ${OUTPUT_DIR}/Activitynet_Zero_Shot_QA/answers/${CKPT_NAME}/gpt \
50
+ --output-json ${OUTPUT_DIR}/Activitynet_Zero_Shot_QA/answers/${CKPT_NAME}/results.json \
51
+ --api-key $AZURE_API_KEY \
52
+ --api-endpoint $AZURE_API_ENDPOINT \
53
+ --api-deployname $AZURE_API_DEPLOYNAME \
54
+ --num-tasks 4
scripts/eval/eval_video_oqa_msvd.sh ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/MSVD_Zero_Shot_QA/answers/${CKPT_NAME}/merge.json
16
+
17
+ if [ ! -f "$output_file" ]; then
18
+ for IDX in $(seq 0 $((CHUNKS-1))); do
19
+ # select the GPUs for the task
20
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
21
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_oqa_activitynet.py \
22
+ --model-path ${CKPT} \
23
+ --video-folder ${EVAL_DATA_DIR}/MSVD_Zero_Shot_QA/videos \
24
+ --question-file ${EVAL_DATA_DIR}/MSVD_Zero_Shot_QA/test_q.json \
25
+ --answer-file ${EVAL_DATA_DIR}/MSVD_Zero_Shot_QA/test_a.json \
26
+ --output-file ${OUTPUT_DIR}/MSVD_Zero_Shot_QA/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
27
+ --num-chunks $CHUNKS \
28
+ --chunk-idx $IDX &
29
+ done
30
+
31
+ wait
32
+
33
+ # Clear out the output file if it exists.
34
+ > "$output_file"
35
+
36
+ #Loop through the indices and concatenate each file.
37
+ for IDX in $(seq 0 $((CHUNKS-1))); do
38
+ cat ${OUTPUT_DIR}/MSVD_Zero_Shot_QA/answers/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
39
+ done
40
+ fi
41
+
42
+
43
+ AZURE_API_KEY=your_key
44
+ AZURE_API_ENDPOINT=your_endpoint
45
+ AZURE_API_DEPLOYNAME=your_deployname
46
+
47
+ python3 videollama2/eval/eval_video_oqa_activitynet.py \
48
+ --pred-path ${output_file} \
49
+ --output-dir ${OUTPUT_DIR}/MSVD_Zero_Shot_QA/answers/${CKPT_NAME}/gpt \
50
+ --output-json ${OUTPUT_DIR}/MSVD_Zero_Shot_QA/answers/${CKPT_NAME}/results.json \
51
+ --api-key $AZURE_API_KEY \
52
+ --api-endpoint $AZURE_API_ENDPOINT \
53
+ --api-deployname $AZURE_API_DEPLOYNAME \
54
+ --num-tasks 4
scripts/eval/eval_video_oqa_vcgpt_1_correctness.sh ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/videochatgpt_gen/answers/correctness/${CKPT_NAME}/merge.json
16
+
17
+ if [ ! -f "$output_file" ]; then
18
+ for IDX in $(seq 0 $((CHUNKS-1))); do
19
+ # select the GPUs for the task
20
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
21
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_oqa_vcgpt_general.py \
22
+ --model-path ${CKPT} \
23
+ --video-folder ${EVAL_DATA_DIR}/videochatgpt_gen/Test_Videos \
24
+ --question-file ${EVAL_DATA_DIR}/videochatgpt_gen/generic_qa.json \
25
+ --answer-file ${OUTPUT_DIR}/videochatgpt_gen/answers/correctness/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
26
+ --num-chunks $CHUNKS \
27
+ --chunk-idx $IDX &
28
+ done
29
+
30
+ wait
31
+
32
+ # Clear out the output file if it exists.
33
+ > "$output_file"
34
+
35
+ #Loop through the indices and concatenate each file.
36
+ for IDX in $(seq 0 $((CHUNKS-1))); do
37
+ cat ${OUTPUT_DIR}/videochatgpt_gen/answers/correctness/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
38
+ done
39
+
40
+ mkdir -p ${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}
41
+ mkdir -p ${OUTPUT_DIR}/videochatgpt_gen/answers/context/${CKPT_NAME}
42
+ cp ${output_file} ${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}/merge.json
43
+ cp ${output_file} ${OUTPUT_DIR}/videochatgpt_gen/answers/context/${CKPT_NAME}/merge.json
44
+ fi
45
+
46
+
47
+ AZURE_API_KEY=your_key
48
+ AZURE_API_ENDPOINT=your_endpoint
49
+ AZURE_API_DEPLOYNAME=your_deployname
50
+
51
+ python3 videollama2/eval/eval_video_oqa_vcgpt_1_correctness.py \
52
+ --pred-path ${output_file} \
53
+ --output-dir ${OUTPUT_DIR}/videochatgpt_gen/answers/correctness/${CKPT_NAME}/gpt \
54
+ --output-json ${OUTPUT_DIR}/videochatgpt_gen/answers/correctness/${CKPT_NAME}/results.json \
55
+ --api-key $AZURE_API_KEY \
56
+ --api-endpoint $AZURE_API_ENDPOINT \
57
+ --api-deployname $AZURE_API_DEPLOYNAME \
58
+ --num-tasks 4
scripts/eval/eval_video_oqa_vcgpt_2_detail.sh ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}/merge.json
16
+
17
+ if [ ! -f "$output_file" ]; then
18
+ for IDX in $(seq 0 $((CHUNKS-1))); do
19
+ # select the GPUs for the task
20
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
21
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/run_inference_video_qa_gpt_general.py \
22
+ --model-path ${CKPT} \
23
+ --video-folder ${EVAL_DATA_DIR}/videochatgpt_gen/Test_Videos \
24
+ --question-file ${EVAL_DATA_DIR}/videochatgpt_gen/generic_qa.json \
25
+ --answer-file ${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
26
+ --num-chunks $CHUNKS \
27
+ --chunk-idx $IDX &
28
+ done
29
+
30
+ wait
31
+
32
+ # Clear out the output file if it exists.
33
+ > "$output_file"
34
+
35
+ #Loop through the indices and concatenate each file.
36
+ for IDX in $(seq 0 $((CHUNKS-1))); do
37
+ cat ${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
38
+ done
39
+
40
+ mkdir -p ${OUTPUT_DIR}/videochatgpt_gen/answers/correctness/${CKPT_NAME}
41
+ mkdir -p ${OUTPUT_DIR}/videochatgpt_gen/answers/context/${CKPT_NAME}
42
+ cp ${output_file} ${OUTPUT_DIR}/videochatgpt_gen/answers/correctness/${CKPT_NAME}/merge.json
43
+ cp ${output_file} ${OUTPUT_DIR}/videochatgpt_gen/answers/context/${CKPT_NAME}/merge.json
44
+ fi
45
+
46
+
47
+ AZURE_API_KEY=your_key
48
+ AZURE_API_ENDPOINT=your_endpoint
49
+ AZURE_API_DEPLOYNAME=your_deployname
50
+
51
+ python3 videollama2/eval/eval_video_oqa_vcgpt_2_detailed_orientation.py \
52
+ --pred-path ${output_file} \
53
+ --output-dir ${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}/gpt \
54
+ --output-json ${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}/results.json \
55
+ --api-key $AZURE_API_KEY \
56
+ --api-endpoint $AZURE_API_ENDPOINT \
57
+ --api-deployname $AZURE_API_DEPLOYNAME \
58
+ --num-tasks 4
scripts/eval/eval_video_oqa_vcgpt_3_context.sh ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/videochatgpt_gen/answers/context/${CKPT_NAME}/merge.json
16
+
17
+ if [ ! -f "$output_file" ]; then
18
+ for IDX in $(seq 0 $((CHUNKS-1))); do
19
+ # select the GPUs for the task
20
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
21
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/run_inference_video_qa_gpt_general.py \
22
+ --model-path ${CKPT} \
23
+ --video-folder ${EVAL_DATA_DIR}/videochatgpt_gen/Test_Videos \
24
+ --question-file ${EVAL_DATA_DIR}/videochatgpt_gen/generic_qa.json \
25
+ --answer-file ${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
26
+ --num-chunks $CHUNKS \
27
+ --chunk-idx $IDX &
28
+ done
29
+
30
+ wait
31
+
32
+ # Clear out the output file if it exists.
33
+ > "$output_file"
34
+
35
+ #Loop through the indices and concatenate each file.
36
+ for IDX in $(seq 0 $((CHUNKS-1))); do
37
+ cat ${OUTPUT_DIR}/videochatgpt_gen/answers/context/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
38
+ done
39
+
40
+ mkdir -p ${OUTPUT_DIR}/videochatgpt_gen/answers/correctness/${CKPT_NAME}
41
+ mkdir -p ${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}
42
+ cp ${output_file} ${OUTPUT_DIR}/videochatgpt_gen/answers/correctness/${CKPT_NAME}/merge.json
43
+ cp ${output_file} ${OUTPUT_DIR}/videochatgpt_gen/answers/detail/${CKPT_NAME}/merge.json
44
+ fi
45
+
46
+
47
+ AZURE_API_KEY=your_key
48
+ AZURE_API_ENDPOINT=your_endpoint
49
+ AZURE_API_DEPLOYNAME=your_deployname
50
+
51
+ python3 videollama2/eval/eval_video_oqa_vcgpt_3_context.py \
52
+ --pred-path ${output_file} \
53
+ --output-dir ${OUTPUT_DIR}/videochatgpt_gen/answers/context/${CKPT_NAME}/gpt \
54
+ --output-json ${OUTPUT_DIR}/videochatgpt_gen/answers/context/${CKPT_NAME}/results.json \
55
+ --api-key $AZURE_API_KEY \
56
+ --api-endpoint $AZURE_API_ENDPOINT \
57
+ --api-deployname $AZURE_API_DEPLOYNAME \
58
+ --num-tasks 4
scripts/eval/eval_video_oqa_vcgpt_4_temporal.sh ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/videochatgpt_gen/answers/temporal/${CKPT_NAME}/merge.json
16
+
17
+ # if output_file not exists then inference
18
+ if [ ! -f "$output_file" ]; then
19
+ for IDX in $(seq 0 $((CHUNKS-1))); do
20
+ # select the GPUs for the task
21
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
22
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_oqa_vcgpt_general.py \
23
+ --model-path ${CKPT} \
24
+ --video-folder ${EVAL_DATA_DIR}/videochatgpt_gen/Test_Videos \
25
+ --question-file ${EVAL_DATA_DIR}/videochatgpt_gen/temporal_qa.json \
26
+ --answer-file ${OUTPUT_DIR}/videochatgpt_gen/answers/temporal/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
27
+ --num-chunks $CHUNKS \
28
+ --chunk-idx $IDX &
29
+ done
30
+
31
+ wait
32
+
33
+ # Clear out the output file if it exists.
34
+ > "$output_file"
35
+
36
+ #Loop through the indices and concatenate each file.
37
+ for IDX in $(seq 0 $((CHUNKS-1))); do
38
+ cat ${OUTPUT_DIR}/videochatgpt_gen/answers/temporal/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
39
+ done
40
+ fi
41
+
42
+
43
+ AZURE_API_KEY=your_key
44
+ AZURE_API_ENDPOINT=your_endpoint
45
+ AZURE_API_DEPLOYNAME=your_deployname
46
+
47
+ python3 videollama2/eval/eval_video_oqa_vcgpt_4_temporal.py \
48
+ --pred-path ${output_file} \
49
+ --output-dir ${OUTPUT_DIR}/videochatgpt_gen/answers/temporal/${CKPT_NAME}/gpt \
50
+ --output-json ${OUTPUT_DIR}/videochatgpt_gen/answers/temporal/${CKPT_NAME}/results.json \
51
+ --api-key $AZURE_API_KEY \
52
+ --api-endpoint $AZURE_API_ENDPOINT \
53
+ --api-deployname $AZURE_API_DEPLOYNAME \
54
+ --num-tasks 4
scripts/eval/eval_video_oqa_vcgpt_5_consistency.sh ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set -x
2
+
3
+ EVAL_DATA_DIR=eval
4
+ OUTPUT_DIR=eval_output
5
+ CKPT=DAMO-NLP-SG/VideoLLaMA2-7B
6
+ CKPT_NAME=$(echo $CKPT | rev | cut -d'/' -f1 | rev)
7
+
8
+ gpu_list="${CUDA_VISIBLE_DEVICES:-0}"
9
+ IFS=',' read -ra GPULIST <<< "$gpu_list"
10
+
11
+ # divide data via the number of GPUs per task
12
+ GPUS_PER_TASK=1
13
+ CHUNKS=$((${#GPULIST[@]}/$GPUS_PER_TASK))
14
+
15
+ output_file=${OUTPUT_DIR}/videochatgpt_gen/answers/consistency/${CKPT_NAME}/merge.json
16
+
17
+ # if output_file not exists then inference
18
+ if [ ! -f "$output_file" ]; then
19
+ for IDX in $(seq 0 $((CHUNKS-1))); do
20
+ # select the GPUs for the task
21
+ gpu_devices=$(IFS=,; echo "${GPULIST[*]:$(($IDX*$GPUS_PER_TASK)):$GPUS_PER_TASK}")
22
+ TRANSFORMERS_OFFLINE=1 CUDA_VISIBLE_DEVICES=${gpu_devices} python3 videollama2/eval/inference_video_oqa_vcgpt_consistency.py \
23
+ --model-path ${CKPT} \
24
+ --video-folder ${EVAL_DATA_DIR}/videochatgpt_gen/Test_Videos \
25
+ --question-file ${EVAL_DATA_DIR}/videochatgpt_gen/consistency_qa.json \
26
+ --answer-file ${OUTPUT_DIR}/videochatgpt_gen/answers/consistency/${CKPT_NAME}/${CHUNKS}_${IDX}.json \
27
+ --num-chunks $CHUNKS \
28
+ --chunk-idx $IDX &
29
+ done
30
+
31
+ wait
32
+
33
+ # Clear out the output file if it exists.
34
+ > "$output_file"
35
+
36
+ #Loop through the indices and concatenate each file.
37
+ for IDX in $(seq 0 $((CHUNKS-1))); do
38
+ cat ${OUTPUT_DIR}/videochatgpt_gen/answers/consistency/${CKPT_NAME}/${CHUNKS}_${IDX}.json >> "$output_file"
39
+ done
40
+ fi
41
+
42
+
43
+ AZURE_API_KEY=your_key
44
+ AZURE_API_ENDPOINT=your_endpoint
45
+ AZURE_API_DEPLOYNAME=your_deployname
46
+
47
+ python3 videollama2/eval/eval_video_oqa_vcgpt_5_consistency.py \
48
+ --pred-path ${output_file} \
49
+ --output-dir ${OUTPUT_DIR}/videochatgpt_gen/answers/consistency/${CKPT_NAME}/gpt \
50
+ --output-json ${OUTPUT_DIR}/videochatgpt_gen/answers/consistency/${CKPT_NAME}/results.json \
51
+ --api-key $AZURE_API_KEY \
52
+ --api-endpoint $AZURE_API_ENDPOINT \
53
+ --api-deployname $AZURE_API_DEPLOYNAME \
54
+ --num-tasks 4
scripts/siglip/finetune_gemma2.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16667
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=128
26
+ LOCAL_BATCH_SIZE=4
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+ echo $GRADIENT_ACCUMULATION_STEPS
29
+
30
+ # Log Arguments
31
+ export TRANSFORMERS_OFFLINE=1
32
+ export WANDB_PROJECT=videollama2gemma2_siglip
33
+ RUN_NAME=vllava_settings
34
+ DATA_DIR=datasets
35
+ OUTP_DIR=work_dirs
36
+
37
+ torchrun --nnodes $WORLD_SIZE \
38
+ --nproc_per_node $NPROC_PER_NODE \
39
+ --master_addr=$MASTER_ADDR \
40
+ --master_port=$MASTER_PORT \
41
+ --node_rank $RANK \
42
+ videollama2/train_flash_attn.py \
43
+ --deepspeed scripts/zero3.json \
44
+ --model_type videollama2_gemma2 \
45
+ --model_path google/gemma-2-2b-it \
46
+ --vision_tower google/siglip-so400m-patch14-384 \
47
+ --mm_projector_type stc_connector_v35 \
48
+ --pretrain_mm_mlp_adapter ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME}/mm_projector.bin \
49
+ --data_path ${DATA_DIR}/videollava_sft/videochatgpt_llavaimage_tune.json \
50
+ --data_folder ${DATA_DIR}/videollava_sft/ \
51
+ --mm_vision_select_layer -2 \
52
+ --image_aspect_ratio pad \
53
+ --num_frames 8 \
54
+ --bf16 True \
55
+ --tf32 True \
56
+ --fp16 False \
57
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/finetune_${RUN_NAME} \
58
+ --num_train_epochs 3 \
59
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
60
+ --per_device_eval_batch_size 4 \
61
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
62
+ --evaluation_strategy "no" \
63
+ --save_strategy "steps" \
64
+ --save_steps 200 \
65
+ --save_total_limit 99 \
66
+ --learning_rate 2e-5 \
67
+ --weight_decay 0. \
68
+ --warmup_ratio 0.03 \
69
+ --lr_scheduler_type "cosine" \
70
+ --logging_steps 1 \
71
+ --model_max_length 2048 \
72
+ --gradient_checkpointing True \
73
+ --dataloader_num_workers 4 \
74
+ --report_to tensorboard \
75
+ --run_name finetune_$RUN_NAME \
scripts/siglip/finetune_mistral.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16667
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=128
26
+ LOCAL_BATCH_SIZE=4
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+ echo $GRADIENT_ACCUMULATION_STEPS
29
+
30
+ # Log Arguments
31
+ export TRANSFORMERS_OFFLINE=1
32
+ export WANDB_PROJECT=videollama2mistral_siglip
33
+ RUN_NAME=vllava_settings
34
+ DATA_DIR=datasets
35
+ OUTP_DIR=work_dirs
36
+
37
+ torchrun --nnodes $WORLD_SIZE \
38
+ --nproc_per_node $NPROC_PER_NODE \
39
+ --master_addr=$MASTER_ADDR \
40
+ --master_port=$MASTER_PORT \
41
+ --node_rank $RANK \
42
+ videollama2/train_flash_attn.py \
43
+ --deepspeed scripts/zero3.json \
44
+ --model_type videollama2 \
45
+ --model_path mistralai/Mistral-7B-Instruct-v0.2 \
46
+ --vision_tower google/siglip-so400m-patch14-384 \
47
+ --mm_projector_type stc_connector_v35 \
48
+ --pretrain_mm_mlp_adapter ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME}/mm_projector.bin \
49
+ --data_path ${DATA_DIR}/videollava_sft/videochatgpt_llavaimage_tune.json \
50
+ --data_folder ${DATA_DIR}/videollava_sft/ \
51
+ --mm_vision_select_layer -2 \
52
+ --image_aspect_ratio pad \
53
+ --num_frames 8 \
54
+ --bf16 True \
55
+ --tf32 True \
56
+ --fp16 False \
57
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/finetune_${RUN_NAME} \
58
+ --num_train_epochs 3 \
59
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
60
+ --per_device_eval_batch_size 4 \
61
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
62
+ --evaluation_strategy "no" \
63
+ --save_strategy "steps" \
64
+ --save_steps 200 \
65
+ --save_total_limit 99 \
66
+ --learning_rate 2e-5 \
67
+ --weight_decay 0. \
68
+ --warmup_ratio 0.03 \
69
+ --lr_scheduler_type "cosine" \
70
+ --logging_steps 1 \
71
+ --model_max_length 2048 \
72
+ --gradient_checkpointing True \
73
+ --dataloader_num_workers 4 \
74
+ --report_to wandb \
75
+ --run_name finetune_$RUN_NAME \
scripts/siglip/finetune_phi3.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16667
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=128
26
+ LOCAL_BATCH_SIZE=4
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+ echo $GRADIENT_ACCUMULATION_STEPS
29
+
30
+ # Log Arguments
31
+ export TRANSFORMERS_OFFLINE=1
32
+ export WANDB_PROJECT=videollama2phi3_siglip
33
+ RUN_NAME=vllava_settings
34
+ DATA_DIR=datasets
35
+ OUTP_DIR=work_dirs
36
+
37
+ torchrun --nnodes $WORLD_SIZE \
38
+ --nproc_per_node $NPROC_PER_NODE \
39
+ --master_addr=$MASTER_ADDR \
40
+ --master_port=$MASTER_PORT \
41
+ --node_rank $RANK \
42
+ videollama2/train_flash_attn.py \
43
+ --deepspeed scripts/zero3.json \
44
+ --model_type videollama2_phi3 \
45
+ --model_path microsoft/Phi-3-mini-4k-instruct \
46
+ --vision_tower google/siglip-so400m-patch14-384 \
47
+ --mm_projector_type stc_connector_v35 \
48
+ --pretrain_mm_mlp_adapter ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME}/mm_projector.bin \
49
+ --data_path ${DATA_DIR}/videollava_sft/videochatgpt_llavaimage_tune.json \
50
+ --data_folder ${DATA_DIR}/videollava_sft/ \
51
+ --mm_vision_select_layer -2 \
52
+ --image_aspect_ratio pad \
53
+ --num_frames 8 \
54
+ --bf16 True \
55
+ --tf32 True \
56
+ --fp16 False \
57
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/finetune_${RUN_NAME} \
58
+ --num_train_epochs 3 \
59
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
60
+ --per_device_eval_batch_size 4 \
61
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
62
+ --evaluation_strategy "no" \
63
+ --save_strategy "steps" \
64
+ --save_steps 200 \
65
+ --save_total_limit 99 \
66
+ --learning_rate 2e-5 \
67
+ --weight_decay 0. \
68
+ --warmup_ratio 0.03 \
69
+ --lr_scheduler_type "cosine" \
70
+ --logging_steps 1 \
71
+ --model_max_length 2048 \
72
+ --gradient_checkpointing True \
73
+ --dataloader_num_workers 4 \
74
+ --report_to tensorboard \
75
+ --run_name finetune_$RUN_NAME \
scripts/siglip/finetune_qwen2.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=128
26
+ LOCAL_BATCH_SIZE=4
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+ echo $GRADIENT_ACCUMULATION_STEPS
29
+
30
+ # Log Arguments
31
+ export TRANSFORMERS_OFFLINE=1
32
+ export WANDB_PROJECT=videollama2qwen2_siglip
33
+ RUN_NAME=vllava_settings
34
+ DATA_DIR=datasets
35
+ OUTP_DIR=work_dirs
36
+
37
+ torchrun --nnodes $WORLD_SIZE \
38
+ --nproc_per_node $NPROC_PER_NODE \
39
+ --master_addr=$MASTER_ADDR \
40
+ --master_port=$MASTER_PORT \
41
+ --node_rank $RANK \
42
+ videollama2/train_flash_attn.py \
43
+ --deepspeed scripts/zero3.json \
44
+ --model_type videollama2_qwen2 \
45
+ --model_path Qwen/Qwen2-7B-Instruct \
46
+ --vision_tower google/siglip-so400m-patch14-384 \
47
+ --mm_projector_type stc_connector_v35 \
48
+ --pretrain_mm_mlp_adapter ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME}/mm_projector.bin \
49
+ --data_path ${DATA_DIR}/videollava_sft/videochatgpt_llavaimage_tune.json \
50
+ --data_folder ${DATA_DIR}/videollava_sft/ \
51
+ --mm_vision_select_layer -2 \
52
+ --image_aspect_ratio pad \
53
+ --num_frames 8 \
54
+ --bf16 True \
55
+ --tf32 True \
56
+ --fp16 False \
57
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/finetune_${RUN_NAME} \
58
+ --num_train_epochs 1 \
59
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
60
+ --per_device_eval_batch_size 4 \
61
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
62
+ --evaluation_strategy "no" \
63
+ --save_strategy "steps" \
64
+ --save_steps 500 \
65
+ --save_total_limit 99 \
66
+ --learning_rate 2e-5 \
67
+ --weight_decay 0. \
68
+ --warmup_ratio 0.03 \
69
+ --lr_scheduler_type "cosine" \
70
+ --logging_steps 1 \
71
+ --model_max_length 2048 \
72
+ --gradient_checkpointing True \
73
+ --dataloader_num_workers 4 \
74
+ --report_to tensorboard \
75
+ --run_name $RUN_NAME \
scripts/siglip/pretrain_gemma2.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=256
26
+ LOCAL_BATCH_SIZE=4
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+ echo $GRADIENT_ACCUMULATION_STEPS
29
+
30
+ # Log Arguments
31
+ export TRANSFORMERS_OFFLINE=1
32
+ export WANDB_PROJECT=videollama2gemma2_siglip
33
+ RUN_NAME=vllava_settings
34
+ DATA_DIR=datasets
35
+ OUTP_DIR=work_dirs
36
+
37
+ torchrun --nnodes $WORLD_SIZE \
38
+ --nproc_per_node $NPROC_PER_NODE \
39
+ --master_addr=$MASTER_ADDR \
40
+ --master_port=$MASTER_PORT \
41
+ --node_rank $RANK \
42
+ videollama2/train_flash_attn.py \
43
+ --deepspeed scripts/zero3.json \
44
+ --model_type videollama2_gemma2 \
45
+ --model_path google/gemma-2-2b-it \
46
+ --vision_tower google/siglip-so400m-patch14-384 \
47
+ --mm_projector_type stc_connector_v35 \
48
+ --tune_mm_mlp_adapter True \
49
+ --data_path ${DATA_DIR}/videollava_pt/valley_llavaimage.json \
50
+ --data_folder ${DATA_DIR}/videollava_pt/ \
51
+ --mm_vision_select_layer -2 \
52
+ --num_frames 8 \
53
+ --bf16 True \
54
+ --tf32 True \
55
+ --fp16 False \
56
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME} \
57
+ --num_train_epochs 1 \
58
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
59
+ --per_device_eval_batch_size 4 \
60
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
61
+ --evaluation_strategy "no" \
62
+ --save_strategy "steps" \
63
+ --save_steps 500 \
64
+ --save_total_limit 99 \
65
+ --learning_rate 1e-3 \
66
+ --weight_decay 0. \
67
+ --warmup_ratio 0.03 \
68
+ --lr_scheduler_type "cosine" \
69
+ --logging_steps 1 \
70
+ --model_max_length 2048 \
71
+ --gradient_checkpointing True \
72
+ --dataloader_num_workers 4 \
73
+ --lazy_preprocess True \
74
+ --report_to tensorboard \
75
+ --run_name pretrain_$RUN_NAME \
scripts/siglip/pretrain_mistral.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=256
26
+ LOCAL_BATCH_SIZE=8
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+ echo $GRADIENT_ACCUMULATION_STEPS
29
+
30
+ # Log Arguments
31
+ export TRANSFORMERS_OFFLINE=1
32
+ export WANDB_PROJECT=videollama2mistral_siglip
33
+ RUN_NAME=vllava_settings
34
+ DATA_DIR=datasets
35
+ OUTP_DIR=work_dirs
36
+
37
+ torchrun --nnodes $WORLD_SIZE \
38
+ --nproc_per_node $NPROC_PER_NODE \
39
+ --master_addr=$MASTER_ADDR \
40
+ --master_port=$MASTER_PORT \
41
+ --node_rank $RANK \
42
+ videollama2/train_flash_attn.py \
43
+ --deepspeed scripts/zero3.json \
44
+ --model_type videollama2 \
45
+ --model_path mistralai/Mistral-7B-Instruct-v0.2 \
46
+ --vision_tower google/siglip-so400m-patch14-384 \
47
+ --mm_projector_type stc_connector_v35 \
48
+ --tune_mm_mlp_adapter True \
49
+ --data_path ${DATA_DIR}/videollava_pt/valley_llavaimage.json \
50
+ --data_folder ${DATA_DIR}/videollava_pt/ \
51
+ --mm_vision_select_layer -2 \
52
+ --num_frames 8 \
53
+ --bf16 True \
54
+ --tf32 True \
55
+ --fp16 False \
56
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME} \
57
+ --num_train_epochs 1 \
58
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
59
+ --per_device_eval_batch_size 4 \
60
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
61
+ --evaluation_strategy "no" \
62
+ --save_strategy "steps" \
63
+ --save_steps 500 \
64
+ --save_total_limit 99 \
65
+ --learning_rate 1e-3 \
66
+ --weight_decay 0. \
67
+ --warmup_ratio 0.03 \
68
+ --lr_scheduler_type "cosine" \
69
+ --logging_steps 1 \
70
+ --model_max_length 2048 \
71
+ --gradient_checkpointing True \
72
+ --dataloader_num_workers 16 \
73
+ --lazy_preprocess True \
74
+ --report_to tensorboard \
75
+ --run_name pretrain_$RUN_NAME \
scripts/siglip/pretrain_phi3.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=256
26
+ LOCAL_BATCH_SIZE=8
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+ echo $GRADIENT_ACCUMULATION_STEPS
29
+
30
+ # Log Arguments
31
+ export TRANSFORMERS_OFFLINE=1
32
+ export WANDB_PROJECT=videollama2phi3_siglip
33
+ RUN_NAME=vllava_settings
34
+ DATA_DIR=datasets
35
+ OUTP_DIR=work_dirs
36
+
37
+ torchrun --nnodes $WORLD_SIZE \
38
+ --nproc_per_node $NPROC_PER_NODE \
39
+ --master_addr=$MASTER_ADDR \
40
+ --master_port=$MASTER_PORT \
41
+ --node_rank $RANK \
42
+ videollama2/train_flash_attn.py \
43
+ --deepspeed scripts/zero3.json \
44
+ --model_type videollama2_phi3 \
45
+ --model_path microsoft/Phi-3-mini-4k-instruct \
46
+ --vision_tower google/siglip-so400m-patch14-384 \
47
+ --mm_projector_type stc_connector_v35 \
48
+ --tune_mm_mlp_adapter True \
49
+ --data_path ${DATA_DIR}/videollava_pt/valley_llavaimage.json \
50
+ --data_folder ${DATA_DIR}/videollava_pt/ \
51
+ --mm_vision_select_layer -2 \
52
+ --num_frames 8 \
53
+ --bf16 True \
54
+ --tf32 True \
55
+ --fp16 False \
56
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME} \
57
+ --num_train_epochs 1 \
58
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
59
+ --per_device_eval_batch_size 4 \
60
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
61
+ --evaluation_strategy "no" \
62
+ --save_strategy "steps" \
63
+ --save_steps 500 \
64
+ --save_total_limit 99 \
65
+ --learning_rate 1e-3 \
66
+ --weight_decay 0. \
67
+ --warmup_ratio 0.03 \
68
+ --lr_scheduler_type "cosine" \
69
+ --logging_steps 1 \
70
+ --model_max_length 2048 \
71
+ --gradient_checkpointing True \
72
+ --dataloader_num_workers 4 \
73
+ --lazy_preprocess True \
74
+ --report_to tensorboard \
75
+ --run_name pretrain_$RUN_NAME \
scripts/siglip/pretrain_qwen2.sh ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=256
26
+ LOCAL_BATCH_SIZE=8
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+ echo $GRADIENT_ACCUMULATION_STEPS
29
+
30
+ # Log Arguments
31
+ export TRANSFORMERS_OFFLINE=1
32
+ export WANDB_PROJECT=videollama2qwen2_siglip
33
+ RUN_NAME=vllava_settings
34
+ DATA_DIR=datasets
35
+ OUTP_DIR=work_dirs
36
+
37
+ torchrun --nnodes $WORLD_SIZE \
38
+ --nproc_per_node $NPROC_PER_NODE \
39
+ --master_addr=$MASTER_ADDR \
40
+ --master_port=$MASTER_PORT \
41
+ --node_rank $RANK \
42
+ videollama2/train_flash_attn.py \
43
+ --deepspeed scripts/zero3.json \
44
+ --model_type videollama2_qwen2 \
45
+ --model_path Qwen/Qwen2-7B-Instruct \
46
+ --vision_tower google/siglip-so400m-patch14-384 \
47
+ --mm_projector_type stc_connector_v35 \
48
+ --tune_mm_mlp_adapter True \
49
+ --data_path ${DATA_DIR}/videollava_pt/valley_llavaimage.json \
50
+ --data_folder ${DATA_DIR}/videollava_pt/ \
51
+ --mm_vision_select_layer -2 \
52
+ --num_frames 8 \
53
+ --bf16 True \
54
+ --tf32 True \
55
+ --fp16 False \
56
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME} \
57
+ --num_train_epochs 1 \
58
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
59
+ --per_device_eval_batch_size 4 \
60
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
61
+ --evaluation_strategy "no" \
62
+ --save_strategy "steps" \
63
+ --save_steps 500 \
64
+ --save_total_limit 99 \
65
+ --learning_rate 1e-3 \
66
+ --weight_decay 0. \
67
+ --warmup_ratio 0.03 \
68
+ --lr_scheduler_type "cosine" \
69
+ --logging_steps 1 \
70
+ --model_max_length 2048 \
71
+ --gradient_checkpointing True \
72
+ --dataloader_num_workers 4 \
73
+ --lazy_preprocess True \
74
+ --report_to tensorboard \
75
+ --run_name $RUN_NAME \
scripts/vllava/finetune.sh ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=128
26
+ LOCAL_BATCH_SIZE=4
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+
29
+ # Log Arguments
30
+ export TRANSFORMERS_OFFLINE=1
31
+ export WANDB_PROJECT=videollama2
32
+ RUN_NAME=vllava_settings
33
+ DATA_DIR=datasets
34
+ OUTP_DIR=work_dirs
35
+
36
+ torchrun --nnodes $WORLD_SIZE \
37
+ --nproc_per_node $NPROC_PER_NODE \
38
+ --master_addr=$MASTER_ADDR \
39
+ --master_port=$MASTER_PORT \
40
+ --node_rank $RANK \
41
+ videollama2/train_flash_attn.py \
42
+ --deepspeed scripts/zero3.json \
43
+ --model_type videollama2 \
44
+ --model_path mistralai/Mistral-7B-Instruct-v0.2 \
45
+ --vision_tower openai/clip-vit-large-patch14-336 \
46
+ --mm_projector_type stc_connector_v35 \
47
+ --pretrain_mm_mlp_adapter ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME}/mm_projector.bin \
48
+ --data_path ${DATA_DIR}/videollava_sft/videochatgpt_llavaimage_tune.json \
49
+ --data_folder ${DATA_DIR}/videollava_sft/ \
50
+ --mm_vision_select_layer -2 \
51
+ --image_aspect_ratio pad \
52
+ --num_frames 8 \
53
+ --bf16 True \
54
+ --tf32 True \
55
+ --fp16 False \
56
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/finetune_${RUN_NAME} \
57
+ --num_train_epochs 1 \
58
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
59
+ --per_device_eval_batch_size 4 \
60
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
61
+ --evaluation_strategy "no" \
62
+ --save_strategy "steps" \
63
+ --save_steps 500 \
64
+ --save_total_limit 99 \
65
+ --learning_rate 2e-5 \
66
+ --weight_decay 0. \
67
+ --warmup_ratio 0.03 \
68
+ --lr_scheduler_type "cosine" \
69
+ --logging_steps 1 \
70
+ --model_max_length 2048 \
71
+ --gradient_checkpointing True \
72
+ --dataloader_num_workers 4 \
73
+ --report_to tensorboard \
74
+ --run_name $RUN_NAME \
scripts/vllava/pretrain.sh ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Environment Variables
4
+ ARG_WORLD_SIZE=${1:-1}
5
+ ARG_NPROC_PER_NODE=${2:-8}
6
+ ARG_MASTER_ADDR="127.0.0.1"
7
+ ARG_MASTER_PORT=16666
8
+ ARG_RANK=0
9
+
10
+ # Multiple conditions
11
+ if [ ! -n "$WORLD_SIZE" ] || [ ! -n "$NPROC_PER_NODE" ]; then
12
+ WORLD_SIZE=$ARG_WORLD_SIZE
13
+ NPROC_PER_NODE=$ARG_NPROC_PER_NODE
14
+ fi
15
+ if [ ! -n "$MASTER_ADDR" ] || [ ! -n "$MASTER_PORT" ] || [ ! -n "$RANK" ]; then
16
+ MASTER_ADDR=$ARG_MASTER_ADDR
17
+ MASTER_PORT=$ARG_MASTER_PORT
18
+ RANK=$ARG_RANK
19
+ fi
20
+
21
+ echo "WORLD_SIZE: $WORLD_SIZE"
22
+ echo "NPROC_PER_NODE: $NPROC_PER_NODE"
23
+
24
+ # Training Arguments
25
+ GLOBAL_BATCH_SIZE=256
26
+ LOCAL_BATCH_SIZE=8
27
+ GRADIENT_ACCUMULATION_STEPS=$[$GLOBAL_BATCH_SIZE/($WORLD_SIZE*$NPROC_PER_NODE*$LOCAL_BATCH_SIZE)]
28
+
29
+ # Log Arguments
30
+ export TRANSFORMERS_OFFLINE=1
31
+ export WANDB_PROJECT=videollama2
32
+ RUN_NAME=vllava_settings
33
+ DATA_DIR=datasets
34
+ OUTP_DIR=work_dirs
35
+
36
+ torchrun --nnodes $WORLD_SIZE \
37
+ --nproc_per_node $NPROC_PER_NODE \
38
+ --master_addr=$MASTER_ADDR \
39
+ --master_port=$MASTER_PORT \
40
+ --node_rank $RANK \
41
+ videollama2/train_flash_attn.py \
42
+ --deepspeed scripts/zero3.json \
43
+ --model_type videollama2 \
44
+ --model_path mistralai/Mistral-7B-Instruct-v0.2 \
45
+ --vision_tower openai/clip-vit-large-patch14-336 \
46
+ --mm_projector_type stc_connector_v35 \
47
+ --tune_mm_mlp_adapter True \
48
+ --data_path ${DATA_DIR}/videollava_pt/valley_llavaimage.json \
49
+ --data_folder ${DATA_DIR}/videollava_pt/ \
50
+ --mm_vision_select_layer -2 \
51
+ --num_frames 8 \
52
+ --bf16 True \
53
+ --tf32 True \
54
+ --fp16 False \
55
+ --output_dir ${OUTP_DIR}/${WANDB_PROJECT}/pretrain_${RUN_NAME} \
56
+ --num_train_epochs 1 \
57
+ --per_device_train_batch_size $LOCAL_BATCH_SIZE \
58
+ --per_device_eval_batch_size 4 \
59
+ --gradient_accumulation_steps $GRADIENT_ACCUMULATION_STEPS \
60
+ --evaluation_strategy "no" \
61
+ --save_strategy "steps" \
62
+ --save_steps 500 \
63
+ --save_total_limit 99 \
64
+ --learning_rate 1e-3 \
65
+ --weight_decay 0. \
66
+ --warmup_ratio 0.03 \
67
+ --lr_scheduler_type "cosine" \
68
+ --logging_steps 1 \
69
+ --model_max_length 2048 \
70
+ --gradient_checkpointing True \
71
+ --dataloader_num_workers 4 \
72
+ --lazy_preprocess True \
73
+ --report_to tensorboard \
74
+ --run_name $RUN_NAME \
serve_videos/2024-10-01/01047cc89321a1a8f88442647d59a97e_3.jpg ADDED
serve_videos/2024-10-01/0151039fcf5ae698df36e30ec84f3681_1.jpg ADDED
serve_videos/2024-10-01/27da6fcd831e07c89bccca0d446c1ebf_6.jpg ADDED
serve_videos/2024-10-01/36ffc3ede02479166140d3754af82726_0.jpg ADDED
serve_videos/2024-10-01/41d66b0e6c66a2ec825c217aeccfd58d_2.jpg ADDED
serve_videos/2024-10-01/6435a100db222d818f142b8a21fe9ea8_7.jpg ADDED
serve_videos/2024-10-01/7896f6bd33f5afed1ff70acfd8dc657a_0.jpg ADDED
serve_videos/2024-10-01/8b308fd1f62b37b8b990cc87c996b14d_6.jpg ADDED
serve_videos/2024-10-01/a2fe273d47b18c9c50cb85a2ce553572_4.jpg ADDED
serve_videos/2024-10-01/ab3a343f94cf27fb1cda3d09b93beea3_3.jpg ADDED