PaliGemma 2 is trained on a diverse set of multilingual and multimodal datasets, including WebLI, CC3M-35L, OpenImages, and WIT, ensuring its capabilities in visual understanding, object localization, and multilingual tasks. The training process includes rigorous data responsibility filtering, such as removing unsafe or toxic content and sensitive personal information, to prioritize safety, privacy, and quality in its applications.
Prerequisites for Installing Google PaliGemma 2 Locally
Make sure you have the following:
- GPUs: 1xH100 SXM (for smooth execution).
- Disk Space: 100 GB free.
- RAM: 64+ GB
- CPU: 64+ Cores
Step-by-Step Process to Install Google PaliGemma 2 Model Locally
For the purpose of this tutorial, we will use a GPU-powered Virtual Machine offered by NodeShift; however, you can replicate the same steps with any other cloud provider of your choice. NodeShift provides the most affordable Virtual Machines at a scale that meets GDPR, SOC2, and ISO27001 requirements.
Step 1: Access model from Hugging Face
Link:
You will be granted access to this model within an hour, provided you have filled in all the details correctly.
and create an account. Once you’ve signed up, log into your account.
Follow the account setup process and provide the necessary details and information.
Navigate to the menu on the left side. Select the GPU Nodes option, create a GPU Node in the Dashboard, click the Create GPU Node button, and create your first Virtual Machine deployment.
Step 4: Select a Model, Region, and Storage
In the “GPU Nodes” tab, select a GPU Model and Storage according to your needs and the geographical region where you want to launch your model.
After choosing the image, click the ‘Create’ button, and your Virtual Machine will be deployed.
Step 8: Connect to Jupyter Notebook
Once your GPU VM deployment is successfully created and has reached the ‘RUNNING’ status, you can navigate to the page of your GPU Deployment Instance. Then, click the ‘Connect’ Button in the top right corner.
Now open Python 3(pykernel) Notebook.
Step 9: Install Torch and Other Libraries
Run the following command to install the torch and other libraries:
pip install torch torchvision torchaudio einops timm pillow
Step 11: Install Accelerate
Run the following command to install the accelerate:
pip install git+https://github.com/huggingface/accelerate
Step 13: Install Huggingface Hub
Run the following command to install the Huggingface hub:
pip install huggingface_hub
Step 15: Login Using Your API Token
Use the huggingface_hub library to log in directly in the notebook:
from huggingface_hub import login
# Replace 'your_api_token_here' with your Hugging Face token
login(token="your hugging face token")
This will store your token securely for the session and allow authenticated access to Hugging Face models.
Conclusion
Google PaliGemma 2 is a groundbreaking open-source model from Google that brings state-of-the-art AI capabilities to developers and researchers. Following this guide, you can quickly deploy Google PaliGemma 2 on a GPU-powered Virtual Machine with NodeShift, harnessing its full potential. NodeShift provides an accessible, secure, affordable platform to run your AI models efficiently. It is an excellent choice for those experimenting with Google PaliGemma 2 and other cutting-edge AI tools.

SOCIAL SHARE CARD GENERATOR