Instructions to use google/paligemma-3b-pt-224 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/paligemma-3b-pt-224 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="google/paligemma-3b-pt-224")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("google/paligemma-3b-pt-224") model = AutoModelForImageTextToText.from_pretrained("google/paligemma-3b-pt-224") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use google/paligemma-3b-pt-224 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "google/paligemma-3b-pt-224" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/paligemma-3b-pt-224", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/google/paligemma-3b-pt-224
- SGLang
How to use google/paligemma-3b-pt-224 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 "google/paligemma-3b-pt-224" \ --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": "google/paligemma-3b-pt-224", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "google/paligemma-3b-pt-224" \ --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": "google/paligemma-3b-pt-224", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use google/paligemma-3b-pt-224 with Docker Model Runner:
docker model run hf.co/google/paligemma-3b-pt-224
What do the last 64 tokens in the PaliGemma tokenizer represent?
3
#30 opened 12 months ago
by
EthanYichengLiu
Paligemma
#29 opened over 1 year ago
by
trinabhgupta
Avoiding RuntimeError when loading in 4-bit / 8-bit
#28 opened over 1 year ago
by
mumeranwaar
Import issue on the google colab
1
#27 opened over 1 year ago
by
shambhavi121212
fixed bash and python code chunks in loading 4 bit
1
#26 opened over 1 year ago
by
Chan-Y
Request: DOI
1
#18 opened almost 2 years ago
by
usf99
Optimization and Conversion of PaliGemma to TFLite / TorchScript
1
#16 opened almost 2 years ago
by
dariopt
Support for Flash Attention?
❤️➕ 2
1
#15 opened almost 2 years ago
by
arnaudstiegler
Pending request
3
#13 opened almost 2 years ago
by
shiron8bit
ValueError: Custom 4D attention mask should be passed in inverted form with max==0
2
#12 opened almost 2 years ago
by
brian-gordon
Request: DOI
1
#9 opened about 2 years ago
by
zss001
Prompt with <image> in the prompt leads to 'RuntimeError: CUDA error: device-side assert triggered'
2
#6 opened about 2 years ago
by
vicaran