Image-Text-to-Text
Transformers
Safetensors
English
Chinese
groundinganything_vlm
text-generation
visual-grounding
object-detection
referring-expression-comprehension
pointing
ocr
document-layout
custom-code
conversational
custom_code
Instructions to use GroundingPI/GroundAnything-VLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GroundingPI/GroundAnything-VLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="GroundingPI/GroundAnything-VLM", 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("GroundingPI/GroundAnything-VLM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GroundingPI/GroundAnything-VLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GroundingPI/GroundAnything-VLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GroundingPI/GroundAnything-VLM", "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/GroundingPI/GroundAnything-VLM
- SGLang
How to use GroundingPI/GroundAnything-VLM 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 "GroundingPI/GroundAnything-VLM" \ --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": "GroundingPI/GroundAnything-VLM", "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 "GroundingPI/GroundAnything-VLM" \ --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": "GroundingPI/GroundAnything-VLM", "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 GroundingPI/GroundAnything-VLM with Docker Model Runner:
docker model run hf.co/GroundingPI/GroundAnything-VLM
|
Download assets/modelscope-logo.svg from GroundingPI/GroundAnything-VLM: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/GroundingPI/GroundAnything-VLM/resolve/main/assets/modelscope-logo.svg
- Command line
-
hf download hf://GroundingPI/GroundAnything-VLM/assets/modelscope-logo.svg
-
curl -L -o modelscope-logo.svg https://huggingface.co/GroundingPI/GroundAnything-VLM/resolve/main/assets/modelscope-logo.svg
1.2 kB
| <svg width="223" height="200" xmlns="http://www.w3.org/2000/svg"> | |
| <g> | |
| <title>Layer 1</title> | |
| <path id="svg_14" fill="#624aff" d="m0,89.84l25.65,0l0,25.64999l-25.65,0l0,-25.64999z"/> | |
| <path id="svg_15" fill="#624aff" d="m99.14,115.49l25.65,0l0,25.65l-25.65,0l0,-25.65z"/> | |
| <path id="svg_16" fill="#624aff" d="m176.09,141.14l-25.64999,0l0,22.19l47.84,0l0,-47.84l-22.19,0l0,25.65z"/> | |
| <path id="svg_17" fill="#36cfd1" d="m124.79,89.84l25.65,0l0,25.64999l-25.65,0l0,-25.64999z"/> | |
| <path id="svg_18" fill="#36cfd1" d="m0,64.19l25.65,0l0,25.65l-25.65,0l0,-25.65z"/> | |
| <path id="svg_19" fill="#624aff" d="m198.28,89.84l25.64999,0l0,25.64999l-25.64999,0l0,-25.64999z"/> | |
| <path id="svg_20" fill="#36cfd1" d="m198.28,64.19l25.64999,0l0,25.65l-25.64999,0l0,-25.65z"/> | |
| <path id="svg_21" fill="#624aff" d="m150.44,42l0,22.19l25.64999,0l0,25.65l22.19,0l0,-47.84l-47.84,0z"/> | |
| <path id="svg_22" fill="#36cfd1" d="m73.49,89.84l25.65,0l0,25.64999l-25.65,0l0,-25.64999z"/> | |
| <path id="svg_23" fill="#624aff" d="m47.84,64.19l25.65,0l0,-22.19l-47.84,0l0,47.84l22.19,0l0,-25.65z"/> | |
| <path id="svg_24" fill="#624aff" d="m47.84,115.49l-22.19,0l0,47.84l47.84,0l0,-22.19l-25.65,0l0,-25.65z"/> | |
| </g> | |
| </svg> |