Instructions to use liuhaotian/llava-v1.6-mistral-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use liuhaotian/llava-v1.6-mistral-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="liuhaotian/llava-v1.6-mistral-7b") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("liuhaotian/llava-v1.6-mistral-7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use liuhaotian/llava-v1.6-mistral-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "liuhaotian/llava-v1.6-mistral-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "liuhaotian/llava-v1.6-mistral-7b", "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/liuhaotian/llava-v1.6-mistral-7b
- SGLang
How to use liuhaotian/llava-v1.6-mistral-7b 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 "liuhaotian/llava-v1.6-mistral-7b" \ --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": "liuhaotian/llava-v1.6-mistral-7b", "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 "liuhaotian/llava-v1.6-mistral-7b" \ --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": "liuhaotian/llava-v1.6-mistral-7b", "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 liuhaotian/llava-v1.6-mistral-7b with Docker Model Runner:
docker model run hf.co/liuhaotian/llava-v1.6-mistral-7b
add AIBOM
#13 opened over 1 year ago
by
sabato-nocera
Potential ways to accelerate for image to text tasks?
#12 opened almost 2 years ago
by
triscuiter
pretrain_mm_mlp_adapter
#11 opened about 2 years ago
by
RavenclawMind
llava-v1.6-mistral-7b
#10 opened about 2 years ago
by
ssh6lq
How many tokens will the image occupy?
#9 opened about 2 years ago
by
wiccanmind
What kind of GPU need to run this model locally on-prem ?
1
#8 opened over 2 years ago
by
eliastick
Some value in config is not used?
#7 opened over 2 years ago
by
fahadh4ilyas
How to enable llava-v1.6-mistral model to output sensitive data (e.g. PII)
3
#6 opened over 2 years ago
by
bernieboy
chat template
👍 4
2
#3 opened over 2 years ago
by
cognitivetech
Fix support for SGLang inference
11
#2 opened over 2 years ago
by
aliencaocao
hugging face version coming?
👍 21
1
#1 opened over 2 years ago
by
ctranslate2-4you