Views
No views yet


| Model | MMBench Test (EN) | MMBench Dev (EN) | MMBench Test (CN) | MMBench Dev (CN) | CCBench Dev |
|---|---|---|---|---|---|
| LLaVA-v1.5-7B | 67.7 | 69.2 | 61.0 | 59.7 | 28.4 |
| LLaVA-InternLM-7B | 69.0 | 68.5 | 66.7 | 63.8 | 37.3 |
| LLaVA-InternLM2-7B | 73.3 | 74.6 | 71.7 | 72.0 | 42.5 |
| Bunny-3B | 69.2 | 68.6 | - | - | - |
| MiniCPM-V | 64.1 | 67.9 | 62.6 | 65.3 | 41.4 |
| llava-clip-internlm2-1_8b-v1 | 63.3 | 63.1 | 63.6 | 61.7 | 35.3 |
| llava-siglip-internlm2-1_8b-v1 | 65.7 | 63.5 | 64.5 | 62.9 | 36.3 |
| llava-siglip-internlm2-1_8b-v2 | 66.6 | 67.1 | 64.5 | 64.1 | 37.3 |


# We need the newest version so clone from github
git clone https://github.com/huggingface/transformers/
git clone https://github.com/huggingface/peft
git clone https://github.com/InternLM/xtunercp -r ./modified_transformers ./transformers
cp -r ./modified_xtuner ./xtunerpip install -e ./transformers
pip install -e ./peft
pip install -e ./xtuner[deepspeed]
apt install git-lfsxtuner chat internlm/internlm2-1_8b \
--visual-encoder google/siglip-so400m-patch14-384 \
--llava StarCycle/llava-siglip-internlm2-1_8b-v2 \
--prompt-template internlm2_chat \
--image $IMAGE_PATHcommand error: 'libGL.so.1: cannot open shared object file: No such file or directory'!# For Ubuntu
sudo apt-get update
sudo apt-get install libgl1-mesa-glx
# For CentOS and Fedora
sudo yum install mesa-libGLError: mkl-service + Intel(R) MKL: MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library.
Try to import numpy first or set the threading layer accordingly. Set MKL_SERVICE_FORCE_INTEL to force it.ImportError:
InternLM2Converter requires the protobuf library but it was not found in your environment. Checkout the instructions on thepip install protobufpip install future tensorboard map_num_proc in xtuner/xtuner/dataset
/huggingface.pydef process(dataset,
do_dataset_tokenization=True,
tokenizer=None,
max_length=None,
dataset_map_fn=None,
template_map_fn=None,
max_dataset_length=None,
split='train',
remove_unused_columns=False,
rename_maps=[],
shuffle_before_pack=True,
pack_to_max_length=True,
use_varlen_attn=False,
input_ids_with_output=True,
with_image_token=False,
map_num_proc=32): # modify it to a smaller number, e.g., 4# . means the llava-dinov2-internlm2-7b-v1 folder you clone
./data/llava_data
├── LLaVA-Pretrain
│ ├── blip_laion_cc_sbu_558k.json
│ ├── blip_laion_cc_sbu_558k_meta.json
│ └── images
├── LLaVA-Instruct-150K
│ └── llava_v1_5_mix665k.json
└── llava_images
├── coco
│ └── train2017
├── gqa
│ └── images
├── ocr_vqa
│ └── images
├── textvqa
│ └── train_images
└── vg
├── VG_100K
└── VG_100K_21# Make sure you have git-lfs installed (https://git-lfs.com)
2git lfs install
3git clone https://huggingface.co/datasets/liuhaotian/LLaVA-Pretrain --depth=1LLaVA-Instruct-150K
```shell
# Make sure you have git-lfs installed (https://git-lfs.com)
git lfs install
git clone https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K --depth=1
``` ⚠️⚠️⚠️ Modify the name of OCR-VQA's images to keep the extension as `.jpg`!
```shell
#!/bin/bash
ocr_vqa_path="<your-directory-path>"
find "$target_dir" -type f | while read file; do
extension="${file##*.}"
if [ "$extension" != "jpg" ]
then
cp -- "$file" "${file%.*}.jpg"
fi
done
```# single GPU
xtuner train ./pretrain.py --deepspeed deepspeed_zero2
# multiple GPU
NPROC_PER_NODE=4 xtuner train ./pretrain.py --deepspeed deepspeed_zero2

NPROC_PER_NODE=4 xtuner train ./finetune.py --deepspeed deepspeed_zero2

xtuner convert pth_to_hf ./finetune.py ./work_dirs/iter_xxx.pth ./my_lora_and_projectorwget https://opencompass.openxlab.space/utils/VLMEval/MMBench_DEV_EN.tsv
wget https://opencompass.openxlab.space/utils/VLMEval/MMBench_TEST_EN.tsv
wget https://opencompass.openxlab.space/utils/VLMEval/MMBench_DEV_CN.tsv
wget https://opencompass.openxlab.space/utils/VLMEval/MMBench_TEST_CN.tsv
wget https://opencompass.openxlab.space/utils/VLMEval/CCBench.tsvNPROC_PER_NODE=8 xtuner mmbench internlm/internlm2-1_8b \
--visual-encoder google/siglip-so400m-patch14-384 \
--llava ./my_lora_and_projector \
--prompt-template internlm2_chat \
--data-path $MMBENCH_DATA_PATH \
--work-dir $RESULT_PATH