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
Download training_args.bin from liuhaotian/llava-v1.6-mistral-7b: direct link, hf CLI and curl.
- Browser
- Download file 7.04 kB
-
https://huggingface.co/liuhaotian/llava-v1.6-mistral-7b/resolve/main/training_args.bin
- Command line
-
hf download hf://liuhaotian/llava-v1.6-mistral-7b/training_args.bin
-
curl -L -o training_args.bin https://huggingface.co/liuhaotian/llava-v1.6-mistral-7b/resolve/main/training_args.bin
7.04 kB
- Xet hash:
- 4efe9f968c2f337dec89a615a232d5af3a0827c0492494365c16f8b52ce06a1e
- Size of remote file:
- 7.04 kB
- SHA256:
- c4afa32f230f004feea7301f637244194ecb01fe655fa6a3ad426091430dc565
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.