Instructions to use lmms-lab/llava-next-72b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lmms-lab/llava-next-72b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lmms-lab/llava-next-72b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("lmms-lab/llava-next-72b") model = AutoModelForCausalLM.from_pretrained("lmms-lab/llava-next-72b") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lmms-lab/llava-next-72b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lmms-lab/llava-next-72b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lmms-lab/llava-next-72b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lmms-lab/llava-next-72b
- SGLang
How to use lmms-lab/llava-next-72b 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 "lmms-lab/llava-next-72b" \ --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": "lmms-lab/llava-next-72b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "lmms-lab/llava-next-72b" \ --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": "lmms-lab/llava-next-72b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lmms-lab/llava-next-72b with Docker Model Runner:
docker model run hf.co/lmms-lab/llava-next-72b
Upload folder using huggingface_hub
Upload folder using huggingface_hub
Multi commit ID: 1af3e17b6a122e0740b4f83cc3efe1ef8de9af756fa65f9877cf4e0c4758750f
Scheduled commits:
- Upload 1 file(s) totalling 4.8G (3960c290658d8031e9b93814d611b83922559849a02ee654416dac101d128cba)
- Upload 1 file(s) totalling 5.0G (6cde8580f0ae372dc90d232ba8a0c227baed01e5e905392066e8a969308e085f)
- Upload 1 file(s) totalling 5.0G (c28add5c0cd8883f16b746b62d4014f556802f568b586f9fe73355836f34b801)
- Upload 1 file(s) totalling 4.8G (b5ca93626b58ffeb223ea9d8dbcde077c17f7f97c1d87f3ad38840495885858d)
- Upload 1 file(s) totalling 4.8G (a03e27f41c924db19cf4807e41f30f6da76b04b0523a098d3c3785b4894c636a)
- Upload 1 file(s) totalling 4.8G (0f560489e555b449ecfecec235994491e3f26c9450ea13482e1a6b008b788f40)
- Upload 1 file(s) totalling 5.0G (2d10e77cb442a007a2478a181da576534c763a8fd0b128831ee149a2e33f2db7)
- Upload 1 file(s) totalling 5.0G (2a64602c26a07ce473ed377b254cd918b5393c7024432bde431cc2c506b980af)
- Upload 1 file(s) totalling 4.8G (cb6c00887f913b52711cb5a0256c20afe23b2925319316c5299fd47fd1525663)
- Upload 1 file(s) totalling 4.8G (f73270668a40489796dc617220d297e622d768e41fcf98c66574c82d2e1bb733)
- Upload 1 file(s) totalling 4.8G (b5d56422b0e8008597c9c54a8247808ce61339a46d6abf5bfff2490dd73545ca)
- Upload 1 file(s) totalling 5.0G (d990669dfbce634185bed28c9e54a98348ff191715a0d44d5c895534accb6869)
- Upload 1 file(s) totalling 5.0G (e21271fe71b8ccf387ac865e8fb20e5e6717a0bd1668209233f8719f38846ea6)
- Upload 1 file(s) totalling 4.8G (cef58368e5a24cfdcda85b6957933d7acfca07d95f75cbda73c4006baa80bfae)
- Upload 1 file(s) totalling 4.8G (740253fa1758a2fd3e00ca6e967c379ddcf0251682e479d34a54279737040d85)
- Upload 1 file(s) totalling 4.8G (06b2ea56b78d9630581dee19dc9394e3dae939e997dd6dd69826389848b6608c)
- Upload 1 file(s) totalling 5.0G (aeac31e5e68fc15bbbded9cb4f953446a7c10038933782e3028fce0f2986e843)
- Upload 1 file(s) totalling 5.0G (71068efee0fac9b7983c14dea997a99efbfe9e71c54c1baed10549ca572fd818)
- Upload 1 file(s) totalling 4.8G (6bbeb932d088414869ea1f73a59a92031618070934d97e7f233e0d537e6312eb)
- Upload 1 file(s) totalling 4.8G (ee3e60f3407f4fba2aec812b8e85ad34beb0c86b0e7b13c02799e7df900ed8fe)
- Upload 1 file(s) totalling 4.8G (8203c846f7d4e2feb8964f5349f112bf6338ea571c449fe05f6dee58a76c988c)
- Upload 1 file(s) totalling 5.0G (39b54b1e090f601f00f6632cdab74d60b82e055cce033293f09bbfd9739151a5)
- Upload 1 file(s) totalling 5.0G (18212b652ebe4c81f5f3f172ee9ca94e6047091c9593ebe8c97c6307691f09ff)
- Upload 1 file(s) totalling 4.8G (a29e2e9b929947575e703e17e146c9f7bd919b4d74d79a8efa4985f3c6291df6)
- Upload 1 file(s) totalling 4.8G (97b76a7cd6e1cc1a622c634098df3ad8fd24bb5dc994c40e64e9612dc39130fc)
- Upload 1 file(s) totalling 4.8G (b0cd7522f91195d96a92eb8776f65596dcfa9ac96b96331d58b2adc687dd5cf2)
- Upload 1 file(s) totalling 5.0G (9664d75668d9d756bd6fae3702bb4ca553bf849e811b16f789a8d06950f9c835)
- Upload 1 file(s) totalling 5.0G (25df41c6f965d925080024c4b1eac46a1a6a521db6da0e228c90d2149392f54f)
- Upload 1 file(s) totalling 4.8G (a153a2efcdc0ca05afd84c11dc4e9643a073279ce7cc5edca9804949d0bb69cf)
- Upload 1 file(s) totalling 3.7G (4b2852fac1f97ffde6f281c753a04f92c45e62d10b56e386ea9535b982616d6a)
- Upload 11 file(s) totalling 12.6M (788509dc075591ec5da14d9c45417a9dde8ac5d6852d4e9e86eed911195832aa)
This is a PR opened using the huggingface_hub library in the context of a multi-commit. PR can be commented as a usual PR. However, please be aware that manually updating the PR description, changing the PR status, or pushing new commits, is not recommended as it might corrupt the commit process. Learn more about multi-commits in this guide.
Multi-commit is now completed! You can ping the repo owner to review the changes. This PR can now be commented or modified without risking to corrupt it.
This is a comment posted using the huggingface_hub library in the context of a multi-commit. Learn more about multi-commits in this guide.
create_pr=False has been passed so PR is automatically merged.
This is a comment posted using the huggingface_hub library in the context of a multi-commit. Learn more about multi-commits in this guide.