PanoVLM
Collection
1 item • Updated
How to use PanocularAI/PanoVLM-500M with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="PanocularAI/PanoVLM-500M", trust_remote_code=True) # Load model directly
from transformers import AutoModelForImageTextToText
model = AutoModelForImageTextToText.from_pretrained("PanocularAI/PanoVLM-500M", trust_remote_code=True, dtype="auto")How to use PanocularAI/PanoVLM-500M with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "PanocularAI/PanoVLM-500M"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "PanocularAI/PanoVLM-500M",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/PanocularAI/PanoVLM-500M
How to use PanocularAI/PanoVLM-500M with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "PanocularAI/PanoVLM-500M" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "PanocularAI/PanoVLM-500M",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "PanocularAI/PanoVLM-500M" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "PanocularAI/PanoVLM-500M",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use PanocularAI/PanoVLM-500M with Docker Model Runner:
docker model run hf.co/PanocularAI/PanoVLM-500M
Configuration Parsing Warning:In tokenizer_config.json: "tokenizer_config.chat_template" must be one of [string, array]
PanoVLM is a linear-attention vision-language model: a FastViT-HD vision encoder (timm) feeding a PanoLM linear-attention causal LM through a lightweight projector.
| Component | Parameters |
|---|---|
| PanoLM LM | ~387 M |
| FastViT-HD vision encoder | ~123 M |
| Projector | ~3 M |
| Total | ~513 M |
torch==2.12.0
transformers==5.8.1
flash-linear-attention==0.5.0
timm==1.0.25
Replace <repo_id> with the HF Hub identifier.
from transformers import AutoModelForImageTextToText, AutoProcessor
from PIL import Image
import requests
repo_id = "<repo_id>"
model = AutoModelForImageTextToText.from_pretrained(
repo_id, trust_remote_code=True,
).cuda()
processor = AutoProcessor.from_pretrained(repo_id, trust_remote_code=True)
url = "https://llava-vl.github.io/static/images/view.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(text="<|image|>An image of", images=image,
return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512, temperature=1.0, top_k=10,
top_p=1.0, do_sample=True, use_cache=False)
print(processor.decode(out[0], skip_special_tokens=True))