Skip to content

Commit

Permalink
add model zoo
Browse files Browse the repository at this point in the history
  • Loading branch information
teowu committed Nov 7, 2023
1 parent 94dc282 commit 2fe99d3
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 41 deletions.
76 changes: 35 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@

## Quick Start

If your server is facing poor connection to Huggingface, we provide an alternative way to [Download_Weights_from_ModelScope](use_with_modelscope/). Click in to see details.
If your server is facing poor connection to Huggingface, we provide an alternative way to [Download_Weights_from_ModelScope](/model_zoo#modelscope). Click in to see details.

对于中国大陆地区的使用者,若您的服务器连接huggingface存在一些困难,我们亦提供通过*魔搭*下载权重的方式。敬请点击参阅[指南](use_with_modelscope/).



### LLaVA-v1.5

#### Install LLaVA.
Expand Down Expand Up @@ -134,36 +136,6 @@ python eval_scripts/llava_v1.5/eval_video_quality.py

</details>

#### Quantitative Evaluations

<details>
<summary>Multi-choice question (MCQ) in Q-Bench.</summary>

```shell
python eval_scripts/mplug_owl_2/eval_qbench_mcq.py
```

</details>


<details>
<summary>Image/Video Quality Assessment</summary>

<strong>Image Quality Assessment:</strong>

```shell
python eval_scripts/mplug_owl_2/eval_image_quality.py
```

<strong>Video Quality Assessment:</strong>

```shell
python eval_scripts/mplug_owl_2/eval_video_quality.py
```

</details>


### mPLUG-Owl-2

*For mPLUG-Owl-2, Only Single GPU Inference is supported now. Please set environmental variable (e.g. `export CUDA_VISIBLE_DEVICES=0`) to make sure that the model can be loaded on only one device.*
Expand Down Expand Up @@ -220,26 +192,48 @@ Note: The results may contain randomness as `do_sample=True` is enabled during c

</details>

#### Quantitative Evaluations

### InternLM-XComposer-VL
<details>
<summary>Multi-choice question (MCQ) in Q-Bench.</summary>

```shell
python eval_scripts/mplug_owl_2/eval_qbench_mcq.py
```

Coming soon.
</details>


## Model Zoo
<details>
<summary>Image/Video Quality Assessment</summary>

All weights are converted into Huggingface format and totally compatible with the base repositories ([LLaVA](https://github.com/haotian-liu/LLaVA/), [mPLUG-Owl](https://github.com/X-PLUG/mPLUG-Owl/), [InternLM-XComposer](https://github.com/InternLM/InternLM-XComposer)). After installing the base repositories, you can change the HF-path in the original evaluation scripts into the following ones, so as to automatically download the Q-Instruct-tuned versions.
<strong>Image Quality Assessment:</strong>

```shell
python eval_scripts/mplug_owl_2/eval_image_quality.py
```

<strong>Video Quality Assessment:</strong>

```shell
python eval_scripts/mplug_owl_2/eval_video_quality.py
```

_Released_:
</details>


### InternLM-XComposer-VL

*---coming soon---*


## Model Zoo

- [LLaVA-v1.5-7B (mix)](https://huggingface.co/teowu/llava_v1.5_7b_qinstruct_preview_v0.1), HF-path: `teowu/llava_v1.5_7b_qinstruct_preview_v0.1`
- [LLaVA-v1.5-13B (mix)](https://huggingface.co/teowu/llava_v1.5_13b_qinstruct_preview_v0.1), HF-path: `teowu/llava_v1.5_13b_qinstruct_preview_v0.1`
- [mPLUG-Owl-2 (mix)](https://huggingface.co/teowu/mplug_owl2_7b_448_qinstruct_preview_v0.1), HF-path: `teowu/mplug_owl2_7b_448_qinstruct_preview_v0.1`
- [InternLM-XComposer-VL (mix)](https://huggingface.co/DLight/internlm_xcomposer_vl_qinstruct_preview_v0.1), HF-path: `DLight/internlm_xcomposer_vl_qinstruct_preview_v0.1`
See [Model Zoo](model_zoo). Both **huggingface** and **modelscope** weights are provided.

## Training

At present, we only provide the training scripts with LLaVA-v1.5. Please see [Training Docs](scripts/llava_v1.5) for more details.
At present, we only provide the training scripts with LLaVA-v1.5 (7B/13B). Please see [Training Docs](scripts/llava_v1.5) for more details.

## License

Expand Down
67 changes: 67 additions & 0 deletions model_zoo/.ipynb_checkpoints/README-checkpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
## Model Zoo


### Huggingface


All weights are converted into Huggingface format and totally compatible with the base repositories ([LLaVA](https://github.com/haotian-liu/LLaVA/), [mPLUG-Owl](https://github.com/X-PLUG/mPLUG-Owl/), [InternLM-XComposer](https://github.com/InternLM/InternLM-XComposer)). See our [quick start](../README.md#quick-start) on how to use them.

_Released_:

- [LLaVA-v1.5-7B (mix)](https://huggingface.co/teowu/llava_v1.5_7b_qinstruct_preview_v0.1), HF-path: `teowu/llava_v1.5_7b_qinstruct_preview_v0.1`
- [LLaVA-v1.5-13B (mix)](https://huggingface.co/teowu/llava_v1.5_13b_qinstruct_preview_v0.1), HF-path: `teowu/llava_v1.5_13b_qinstruct_preview_v0.1`
- [mPLUG-Owl-2 (mix)](https://huggingface.co/teowu/mplug_owl2_7b_448_qinstruct_preview_v0.1), HF-path: `teowu/mplug_owl2_7b_448_qinstruct_preview_v0.1`
- [InternLM-XComposer-VL (mix)](https://huggingface.co/DLight1551/internlm-xcomposer-vl-7b-qinstruct-full), HF-path: `DLight1551/internlm-xcomposer-vl-7b-qinstruct-full`


### ModelScope

If your server is facing poor connection to Huggingface, we provide an alternative way to download weights from ModelScope. Different from direct Huggingface weights, you need to use the two following steps to load them:

#### Step 1: Download Weights


The links are as follows (WIP):


_Released_:

- [LLaVA-v1.5-7B (mix)](https://www.modelscope.cn/models/qfuture/llava_v1.5_7b_qinstruct_preview_v0.1), HF-path: `qfuture/llava_v1.5_7b_qinstruct_preview_v0.1`
- [LLaVA-v1.5-13B (mix)](https://www.modelscope.cn/models/qfuture/llava_v1.5_13b_qinstruct_preview_v0.1), HF-path: `qfuture/llava_v1.5_13b_qinstruct_preview_v0.1`
- [mPLUG-Owl-2 (mix)](https://www.modelscope.cn/models/qfuture/mplug_owl_2_qinstruct_preview_v0.1), ModelScope-path: `qfuture/mplug_owl_2_qinstruct_preview_v0.1`


_Coming Soon_:

- InternLM-XComposer-VL (mix)

To use them, you need to install `Git LFS` and then clone the repositories directly from ModelScope, under the main directory of Q-Instruct.

```shell
git clone https://www.modelscope.cn/models/qfuture/$MODEL_NAME_qinstruct_preview_v0.1.git
```

#### Step 2: Redirect the Model Paths to Your Local Directory

After that, modify the `model_path` in [quick start](../README.md#quick-start) to the local path (i.e. `$MODEL_NAME_qinstruct_preview_v0.1`) to smoothly load the weights downloaded from ModelScope.


See the Example Code for Single Query on LLaVA-v1.5-7B below:

```python
from llava.mm_utils import get_model_name_from_path
from llava.eval.run_llava import eval_model
model_path = "llava_v1.5_7b_qinstruct_preview_v0.1/" ## Modify Here to Your Local Relative Path ##
prompt = "Rate the quality of the image. Think step by step."
image_file = "fig/sausage.jpg"
args = type('Args', (), {
"model_path": model_path,
"model_base": None,
"model_name": get_model_name_from_path(model_path),
"query": prompt,
"conv_mode": None,
"image_file": image_file,
"sep": ",",
})()
eval_model(args)
```
67 changes: 67 additions & 0 deletions model_zoo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
## Model Zoo


### Huggingface


All weights are converted into Huggingface format and totally compatible with the base repositories ([LLaVA](https://github.com/haotian-liu/LLaVA/), [mPLUG-Owl](https://github.com/X-PLUG/mPLUG-Owl/), [InternLM-XComposer](https://github.com/InternLM/InternLM-XComposer)). See our [quick start](../README.md#quick-start) on how to use them.

_Released_:

- [LLaVA-v1.5-7B (mix)](https://huggingface.co/teowu/llava_v1.5_7b_qinstruct_preview_v0.1), HF-path: `teowu/llava_v1.5_7b_qinstruct_preview_v0.1`
- [LLaVA-v1.5-13B (mix)](https://huggingface.co/teowu/llava_v1.5_13b_qinstruct_preview_v0.1), HF-path: `teowu/llava_v1.5_13b_qinstruct_preview_v0.1`
- [mPLUG-Owl-2 (mix)](https://huggingface.co/teowu/mplug_owl2_7b_448_qinstruct_preview_v0.1), HF-path: `teowu/mplug_owl2_7b_448_qinstruct_preview_v0.1`
- [InternLM-XComposer-VL (mix)](https://huggingface.co/DLight1551/internlm-xcomposer-vl-7b-qinstruct-full), HF-path: `DLight1551/internlm-xcomposer-vl-7b-qinstruct-full`


### ModelScope

If your server is facing poor connection to Huggingface, we provide an alternative way to download weights from ModelScope. Different from direct Huggingface weights, you need to use the two following steps to load them:

#### Step 1: Download Weights


The links are as follows (WIP):


_Released_:

- [LLaVA-v1.5-7B (mix)](https://www.modelscope.cn/models/qfuture/llava_v1.5_7b_qinstruct_preview_v0.1), HF-path: `qfuture/llava_v1.5_7b_qinstruct_preview_v0.1`
- [LLaVA-v1.5-13B (mix)](https://www.modelscope.cn/models/qfuture/llava_v1.5_13b_qinstruct_preview_v0.1), HF-path: `qfuture/llava_v1.5_13b_qinstruct_preview_v0.1`
- [mPLUG-Owl-2 (mix)](https://www.modelscope.cn/models/qfuture/mplug_owl_2_qinstruct_preview_v0.1), ModelScope-path: `qfuture/mplug_owl_2_qinstruct_preview_v0.1`


_Coming Soon_:

- InternLM-XComposer-VL (mix)

To use them, you need to install `Git LFS` and then clone the repositories directly from ModelScope, under the main directory of Q-Instruct.

```shell
git clone https://www.modelscope.cn/models/qfuture/$MODEL_NAME_qinstruct_preview_v0.1.git
```

#### Step 2: Redirect the Model Paths to Your Local Directory

After that, modify the `model_path` in [quick start](../README.md#quick-start) to the local path (i.e. `$MODEL_NAME_qinstruct_preview_v0.1`) to smoothly load the weights downloaded from ModelScope.


See the Example Code for Single Query on LLaVA-v1.5-7B below:

```python
from llava.mm_utils import get_model_name_from_path
from llava.eval.run_llava import eval_model
model_path = "llava_v1.5_7b_qinstruct_preview_v0.1/" ## Modify Here to Your Local Relative Path ##
prompt = "Rate the quality of the image. Think step by step."
image_file = "fig/sausage.jpg"
args = type('Args', (), {
"model_path": model_path,
"model_base": None,
"model_name": get_model_name_from_path(model_path),
"query": prompt,
"conv_mode": None,
"image_file": image_file,
"sep": ",",
})()
eval_model(args)
```

0 comments on commit 2fe99d3

Please sign in to comment.