AlignGPT: Multi-modal Large Language Models with Adaptive Alignment Capability
Paper • 2405.14129 • Published • 14
How to use nlpzhaof/aligngpt-7b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="nlpzhaof/aligngpt-7b") # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("nlpzhaof/aligngpt-7b", dtype="auto")How to use nlpzhaof/aligngpt-7b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "nlpzhaof/aligngpt-7b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "nlpzhaof/aligngpt-7b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/nlpzhaof/aligngpt-7b
How to use nlpzhaof/aligngpt-7b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "nlpzhaof/aligngpt-7b" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "nlpzhaof/aligngpt-7b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "nlpzhaof/aligngpt-7b" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "nlpzhaof/aligngpt-7b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use nlpzhaof/aligngpt-7b with Docker Model Runner:
docker model run hf.co/nlpzhaof/aligngpt-7b
[Project Page] [Paper] [Demo] [Model]
Authors: Fei Zhao*, Taotian Pang*, Chunhui Li, Zhen Wu, Junjie Guo, Shangyu Xing, Xinyu Dai
| Model | LLM | Vision Backbone | Pre-training | Instruct-tuning |
|---|---|---|---|---|
| AlignGPT-7B | Vicuna 7B | CLIP ViT-L/14 | aligngpt-7b-pretrain | aligngpt-7b |
| AlignGPT-13B | Vicuna 13B | CLIP ViT-L/14 | aligngpt-13b-pretrain | aligngpt-13b |
| AlignGPT-LLaMA2 | LLaMA-2-7B-Chat | CLIP ViT-L/14 | To be released | To be released |
| AlignGPT-LLaMA3 | LLaMA-3-8B-Base | CLIP ViT-L/14 | To be released | To be released |
| Model | VQAv2 | GQA | VizWiz | SQA | T-VQA | POPE | MME | MM-Bench | MM-Bench-CN | SEED | LLaVA-Bench-Wild | MM-Vet |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AlignGPT-7B | 79.1 | 62.9 | 54.2 | 68.5 | 58.4 | 86.0 | 1527.4 | 67.3 | 59.9 | 66.5 | 68.4 | 30.8 |
| AlignGPT-13B | 80.0 | 63.6 | 56.4 | 70.3 | 60.2 | 86.2 | 1572.0 | 69.5 | 63.7 | 67.8 | 75.2 | 35.6 |
If you find AlignGPT useful for your research and applications, please cite using this BibTeX:
@misc{zhao2024aligngpt,
title={AlignGPT: Multi-modal Large Language Models with Adaptive Alignment Capability},
author={Fei Zhao and Taotian Pang and Chunhui Li and Zhen Wu and Junjie Guo and Shangyu Xing and Xinyu Dai},
year={2024},
eprint={2405.14129},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
The data and checkpoint is intended and licensed for research use only. They are also restricted to uses that follow the license agreement of LLaMA, Vicuna and GPT-4. The dataset is CC BY NC 4.0 (allowing only non-commercial use) and models trained using the dataset should not be used outside of research purposes.