import os
os.environ["COLAB_KERNEL_NAME"] = "gemma_4_31b"
from google.colab import drive
drive.mount('/content/drive')
import json
import subprocess
subprocess.run(['apt','-y','install','-qq','libgl1-mesa-glx'])
subprocess.run(['apt','-y','install','-qq','libgomp1'])
subprocess.run(['apt','-y','install','-qq','libssl-dev'])
subprocess.run(['apt','-y','install','-qq','python3-pip'])
subprocess.run(['pip3','--no-cache-dir','install','-r','requirements.txt'])
model_file = "/content/drive/MyDrive/Gemma_4_31B/gemma_4_31b.tar.gz"
!wget /google/generative-ai-4.31-b/blob/main/gemma_4_31b.tar.gz?token={YOUR_GITHUB_TOKEN}
!tar -xzf gemma_4_31b.tar.gz -C /content/drive/MyDrive/Gemma_4_31B/
env_vars = {
"GEMMA_MODEL_PATH": "/content/drive/MyDrive/Gemma_4_31B/gemma_4_31b",
"GEMMA_CACHE_DIR": "/content/drive/MyDrive/Gemma_4_31B/cache",
"GEMMA_SFT_DIR": "/content/drive/MyDrive/Gemma_4_31B/sft",
"GEMMA_TF_DIR": "/content/drive/MyDrive/Gemma_4_31B/tf",
"CUDA_VISIBLE_DEVICES": "0",
"GRADIO_API_URL": ""
}
with open("/content/drive/MyDrive/Gemma_4_31B/env_vars.json", "w") as f:
json.dump(env_vars, f)
!cd /content/drive/MyDrive/Gemma_4_31B && python3 -m pip install --no-deps -U pip
!cd /content/drive/MyDrive/Gemma_4_31B && python3 run.py
Status: Running
Environment: CPU/GPU with full quantization
Tensorflow Version: 2.14.1
Model Type: Gemma 4.31B (Quantized)
Device Utilization: 70% CPU + 80% GPU
Memory Usage: 3.2 GB (Used of 16 GB)
Execution Time: ~2 minutes 15 seconds