Instructions to use shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini
- SGLang
How to use shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
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 "shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini with Docker Model Runner:
docker model run hf.co/shi-labs/pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini
pretrain_dsg_OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini Model Card
Note: This is the pretrained model used for OLA-VLM-CLIP-ConvNeXT-Phi3-4k-mini.
OLA-VLM distills target visual information into the intermediate representations of the LLM from a set of target encoders. It adopts a predictive embedding optimization approach at selected LLM layers during training to minimize the embedding losses along with the next token prediction (NTP) objective, resulting in a vision-centric approach to training the Multimodal Large Language Model.
- GitHub Repo: https://github.com/SHI-Labs/OLA-VLM
- Project Page: https://praeclarumjj3.github.io/ola_vlm/
Citation
If you found our work useful in your research, please consider starring ⭐ us on GitHub and citing 📚 us in your research!
@article{jain2024ola_vlm,
title={{OLA-VLM: Elevating Visual Perception in Multimodal LLMs with Auxiliary Embedding Distillation}},
author={Jitesh Jain and Zhengyuan Yang and Humphrey Shi and Jianfeng Gao and Jianwei Yang},
journal={arXiv},
year={2024}
}
- Downloads last month
- 6