liuhaotian/LLaVA-Pretrain
Preview • Updated • 2.4k • 219
How to use shikiw/LLaVA-v1.5-MoCa-7B-pretrain with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="shikiw/LLaVA-v1.5-MoCa-7B-pretrain") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("shikiw/LLaVA-v1.5-MoCa-7B-pretrain")
model = AutoModelForCausalLM.from_pretrained("shikiw/LLaVA-v1.5-MoCa-7B-pretrain")How to use shikiw/LLaVA-v1.5-MoCa-7B-pretrain with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "shikiw/LLaVA-v1.5-MoCa-7B-pretrain"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "shikiw/LLaVA-v1.5-MoCa-7B-pretrain",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/shikiw/LLaVA-v1.5-MoCa-7B-pretrain
How to use shikiw/LLaVA-v1.5-MoCa-7B-pretrain with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "shikiw/LLaVA-v1.5-MoCa-7B-pretrain" \
--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": "shikiw/LLaVA-v1.5-MoCa-7B-pretrain",
"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 "shikiw/LLaVA-v1.5-MoCa-7B-pretrain" \
--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": "shikiw/LLaVA-v1.5-MoCa-7B-pretrain",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use shikiw/LLaVA-v1.5-MoCa-7B-pretrain with Docker Model Runner:
docker model run hf.co/shikiw/LLaVA-v1.5-MoCa-7B-pretrain
If you find this model useful, please cite the following paper
@article{huang2024deciphering,
title={Deciphering Cross-Modal Alignment in Large Vision-Language Models with Modality Integration Rate},
author={Huang, Qidong and Dong, Xiaoyi and Zhang, Pan and Zang, Yuhang and Cao, Yuhang and Wang, Jiaqi and Lin, Dahua and Zhang, Weiming and Yu, Nenghai},
journal={arXiv preprint arXiv:2410.07167},
year={2024}
}
Base model
lmsys/vicuna-7b-v1.5