Instructions to use sscollab2/gemma3_checkpoint_step100 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use sscollab2/gemma3_checkpoint_step100 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-3-4b-it") model = PeftModel.from_pretrained(base_model, "sscollab2/gemma3_checkpoint_step100") - Notebooks
- Google Colab
- Kaggle
Add vLLM serving instructions
Browse files
README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: google/gemma-3-4b-it
|
| 3 |
+
library_name: peft
|
| 4 |
+
tags:
|
| 5 |
+
- gemma3
|
| 6 |
+
- lora
|
| 7 |
+
- peft
|
| 8 |
+
- vllm
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Gemma 3 Checkpoint Step 100
|
| 12 |
+
|
| 13 |
+
This repository contains a LoRA adapter checkpoint trained for `google/gemma-3-4b-it`.
|
| 14 |
+
|
| 15 |
+
## Files
|
| 16 |
+
|
| 17 |
+
- `adapter_model.safetensors`: LoRA adapter weights
|
| 18 |
+
- `adapter_config.json`: PEFT adapter configuration
|
| 19 |
+
|
| 20 |
+
## Serving with vLLM
|
| 21 |
+
|
| 22 |
+
This adapter can be served with vLLM by loading the Gemma 3 base model and enabling the LoRA module from this repository.
|
| 23 |
+
|
| 24 |
+
```bash
|
| 25 |
+
PORT=8071
|
| 26 |
+
GPU=0
|
| 27 |
+
MODEL_ID=google/gemma-3-4b-it
|
| 28 |
+
SERVED_MODEL_NAME=gemma3_with_reasoning
|
| 29 |
+
ADAPTER_REPO=sscollab2/gemma3_checkpoint_step100
|
| 30 |
+
|
| 31 |
+
CUDA_VISIBLE_DEVICES="$GPU" vllm serve "$MODEL_ID" \
|
| 32 |
+
--host 0.0.0.0 \
|
| 33 |
+
--port "$PORT" \
|
| 34 |
+
--tensor-parallel-size 1 \
|
| 35 |
+
--gpu-memory-utilization 0.90 \
|
| 36 |
+
--max-model-len 32768 \
|
| 37 |
+
--served-model-name gemma3_base \
|
| 38 |
+
--enable-lora \
|
| 39 |
+
--lora-modules "${SERVED_MODEL_NAME}=${ADAPTER_REPO}" \
|
| 40 |
+
--max-lora-rank 16 \
|
| 41 |
+
--enable-auto-tool-choice \
|
| 42 |
+
--tool-call-parser hermes \
|
| 43 |
+
--limit-mm-per-prompt '{"image":10,"audio":0}'
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
Once the server is ready, call the LoRA-served model name:
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
curl http://127.0.0.1:8071/v1/chat/completions \
|
| 50 |
+
-H "Content-Type: application/json" \
|
| 51 |
+
-d '{
|
| 52 |
+
"model": "gemma3_with_reasoning",
|
| 53 |
+
"messages": [
|
| 54 |
+
{"role": "user", "content": "Hello!"}
|
| 55 |
+
]
|
| 56 |
+
}'
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
For the local serving script this was based on, see:
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
/local3/elaine1wan/SS_inference/SS_inference_0507/gemma3_scripts/run_serve_gemma3_checkpoint.sh
|
| 63 |
+
```
|