Skip to content

Commit 3d78d4d

Browse files
committed
Release code and models
1 parent 793efa4 commit 3d78d4d

File tree

514 files changed

+359518
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

514 files changed

+359518
-1
lines changed

.flake8

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
ignore = E501, F403, C901, W504, W605, E251, E122, E126, E127, E722, W503, E128, E741
3+
select = E1, E3, E502, E7, E9, W1, W5, W6
4+
max-line-length = 180
5+
exclude=*.egg/*,build,dist,detection/configs/*

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,13 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161+
162+
.idea/
163+
164+
.DS_Store
165+
data_process/
166+
internvl_chat/work_dirs/
167+
internvl_chat/unittest/
168+
internvl_chat/shell/
169+
internvl_chat/data/
170+
Husky2/*

.isort.cfg

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[isort]
2+
line-length = 180
3+
multi_line_output = 0
4+
extra_standard_library = setuptools
5+
known_third_party = PIL,asynctest,cityscapesscripts,cv2,gather_models,matplotlib,mmcv,numpy,onnx,onnxruntime,pycocotools,pytest,pytorch_sphinx_theme,requests,scipy,seaborn,six,terminaltables,torch,ts,yaml
6+
no_lines_before = STDLIB,LOCALFOLDER
7+
default_section = THIRDPARTY
8+
9+
[yapf]
10+
BASED_ON_STYLE = pep8
11+
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true
12+
SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true
13+
14+
[codespell]
15+
skip = *.ipynb
16+
quiet-level = 3
17+
ignore-words-list = patten,nd,ty,mot,hist,formating,winn,gool,datas,wan,confids,TOOD,tood
18+
© 2022 GitHub, Inc.
19+
Terms
20+
Privacy
21+
Security
22+
Status
23+
Docs
24+
Contact GitHub
25+
Pricing
26+
API

.pre-commit-config.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
exclude: ^llava/
2+
repos:
3+
- repo: https://github.com/PyCQA/flake8
4+
rev: 5.0.4
5+
hooks:
6+
- id: flake8
7+
- repo: https://github.com/PyCQA/isort
8+
rev: 5.11.5
9+
hooks:
10+
- id: isort
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v4.3.0
13+
hooks:
14+
- id: trailing-whitespace
15+
- id: check-yaml
16+
- id: end-of-file-fixer
17+
- id: requirements-txt-fixer
18+
- id: double-quote-string-fixer
19+
- id: check-merge-conflict
20+
- id: fix-encoding-pragma
21+
args: ["--remove"]
22+
- id: mixed-line-ending
23+
args: ["--fix=lf"]
24+
- repo: https://github.com/executablebooks/mdformat
25+
rev: 0.7.9
26+
hooks:
27+
- id: mdformat
28+
args: ["--number"]
29+
additional_dependencies:
30+
- mdformat-openmmlab
31+
- mdformat_frontmatter
32+
- linkify-it-py

INSTALLATION.md

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## 🛠️ Installation
2+
3+
- Clone this repository:
4+
5+
```bash
6+
git clone https://github.com/OpenGVLab/InternVL.git
7+
```
8+
9+
- Create a conda virtual environment and activate it:
10+
11+
```bash
12+
conda create -n internvl python=3.9 -y
13+
conda activate internvl
14+
```
15+
16+
- Install `PyTorch>=2.0` and `torchvision>=0.15.2` with `CUDA>=11.6`:
17+
18+
For examples, to install `torch==2.0.1` with `CUDA==11.8`:
19+
20+
```bash
21+
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 -c pytorch -c nvidia
22+
# or
23+
pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
24+
```
25+
26+
- Install `flash-attn==0.2.8` :
27+
28+
If you want to fully replicate my results, please install `v0.2.8`, otherwise install the latest version.
29+
30+
This is because different versions of flash attention yield slight differences in results.
31+
32+
```bash
33+
git clone https://github.com/Dao-AILab/flash-attention.git
34+
cd flash-attention
35+
git checkout v0.2.8
36+
python setup.py install
37+
```
38+
39+
- Install `timm==0.6.11` and `mmcv-full==1.6.2`:
40+
41+
```bash
42+
pip install -U openmim
43+
pip install timm==0.6.11
44+
mim install mmcv-full==1.6.2
45+
```
46+
47+
- Install `apex` (optional):
48+
49+
```bash
50+
git clone https://github.com/NVIDIA/apex.git
51+
git checkout 2386a912164b0c5cfcd8be7a2b890fbac5607c82 # https://github.com/NVIDIA/apex/issues/1735
52+
pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" ./
53+
```
54+
55+
- Install other requirements:
56+
57+
```bash
58+
pip install opencv-python termcolor yacs pyyaml scipy
59+
```

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 OpenGVLab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)