├── setup.sh └── README.md /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # === 1. Install Dependencies === 5 | echo "Installing dependencies..." 6 | sudo apt-get update && sudo apt-get install -y build-essential cmake git curl 7 | 8 | # === 2. Clone gemma.cpp Repository === 9 | echo "Cloning gemma.cpp repository..." 10 | git clone https://github.com/google/gemma.cpp.git 11 | cd gemma.cpp 12 | 13 | # === 3. Build the Project === 14 | echo "Building gemma.cpp..." 15 | mkdir -p build && cd build 16 | cmake .. 17 | make -j 4 gemma # 4 is number of processors to use, can be changed as per the system configuration 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Running Gemma 3 model using gemma cpp 2 | 3 | This repository provides a streamlined setup to run Google's Gemma 3 model using the lightweight and efficient gemma.cpp framework. Gemma 3 models are multimodal, handling text and image input and generating text output, with open weights for both pre-trained variants and instruction-tuned variants 4 | 5 | # Demo 6 | https://github.com/user-attachments/assets/b358b5cb-3c85-466d-92c8-cad67df92f0d 7 | 8 | 9 | # Flow chart 10 | image 11 | 12 | # Run the model 13 | 1. Run the `setup.sh` 14 | 2. Download the Gemma3 model from the kaggle `google/gemma-3` and place the tokenizer and model file in the `build` directory 15 | 3. ```./gemma --tokenizer tokenizer.spm --model gemma3-4b --weights 4b-it-sfp.sbs``` 16 | 17 | --------------------------------------------------------------------------------