Image-Text-to-Text
Transformers
Safetensors
English
locateanything
feature-extraction
nvidia
eagle
vision
object-detection
grounding
conversational
custom_code
Instructions to use nvidia/LocateAnything-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/LocateAnything-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="nvidia/LocateAnything-3B", 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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nvidia/LocateAnything-3B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nvidia/LocateAnything-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/LocateAnything-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/LocateAnything-3B", "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/nvidia/LocateAnything-3B
- SGLang
How to use nvidia/LocateAnything-3B 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 "nvidia/LocateAnything-3B" \ --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": "nvidia/LocateAnything-3B", "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 "nvidia/LocateAnything-3B" \ --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": "nvidia/LocateAnything-3B", "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 nvidia/LocateAnything-3B with Docker Model Runner:
docker model run hf.co/nvidia/LocateAnything-3B
Refine LA Flash plan documentation
Browse files
kernel_utils/README.md
CHANGED
|
@@ -25,9 +25,6 @@ types:
|
|
| 25 |
| `0` | Full attention over the listed key segment or packed key segments. |
|
| 26 |
| `1` | Bottom-right causal attention. |
|
| 27 |
|
| 28 |
-
The old local CUDA-only encodings (`100 + block_size` and `10000 + ...`) were
|
| 29 |
-
removed from the release.
|
| 30 |
-
|
| 31 |
## Runtime Knobs
|
| 32 |
|
| 33 |
| Variable | Default | Meaning |
|
|
|
|
| 25 |
| `0` | Full attention over the listed key segment or packed key segments. |
|
| 26 |
| `1` | Bottom-right causal attention. |
|
| 27 |
|
|
|
|
|
|
|
|
|
|
| 28 |
## Runtime Knobs
|
| 29 |
|
| 30 |
| Variable | Default | Meaning |
|
kernel_utils/range_attention.py
CHANGED
|
@@ -87,8 +87,8 @@ def _coalesce_query_groups(q_ranges, k_ranges, attn_type_map):
|
|
| 87 |
attn_type = int(attn_type)
|
| 88 |
if attn_type not in (0, 1):
|
| 89 |
raise RuntimeError(
|
| 90 |
-
"LA Flash path only supports attn_type 0/1. "
|
| 91 |
-
f"Got attn_type={attn_type}; regenerate
|
| 92 |
)
|
| 93 |
if last_q is None:
|
| 94 |
grouped_q.append([key[0], key[1]])
|
|
|
|
| 87 |
attn_type = int(attn_type)
|
| 88 |
if attn_type not in (0, 1):
|
| 89 |
raise RuntimeError(
|
| 90 |
+
"LA Flash path only supports FlashAttention-compatible attn_type 0/1. "
|
| 91 |
+
f"Got attn_type={attn_type}; regenerate a type 0/1 range plan."
|
| 92 |
)
|
| 93 |
if last_q is None:
|
| 94 |
grouped_q.append([key[0], key[1]])
|