VisPer-LM
Collection
Elevating Visual Perception in Multimodal LLMs with Visual Embedding Distillation • 22 items • Updated
How to use shi-labs/probe_depth_llava-1.5-pt-0.5ift with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="shi-labs/probe_depth_llava-1.5-pt-0.5ift")
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/probe_depth_llava-1.5-pt-0.5ift", dtype="auto")How to use shi-labs/probe_depth_llava-1.5-pt-0.5ift with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "shi-labs/probe_depth_llava-1.5-pt-0.5ift"
# 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/probe_depth_llava-1.5-pt-0.5ift",
"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 run hf.co/shi-labs/probe_depth_llava-1.5-pt-0.5ift
How to use shi-labs/probe_depth_llava-1.5-pt-0.5ift with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "shi-labs/probe_depth_llava-1.5-pt-0.5ift" \
--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/probe_depth_llava-1.5-pt-0.5ift",
"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 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/probe_depth_llava-1.5-pt-0.5ift" \
--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/probe_depth_llava-1.5-pt-0.5ift",
"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"
}
}
]
}
]
}'How to use shi-labs/probe_depth_llava-1.5-pt-0.5ift with Docker Model Runner:
docker model run hf.co/shi-labs/probe_depth_llava-1.5-pt-0.5ift
This model checkpoint contains the depth probes for CLIP-ConvNeXT-XXL Llama-3-8b based LLaVA-1.5 model after the PT and 50% IFT stages, i.e., trained on the LLaVA-558K and 50% LLaVA-665K dataset. Please refer to documentation for more details.
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}
}