Instructions to use qiuxi337/gemma-3-12b-it-grpo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use qiuxi337/gemma-3-12b-it-grpo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="qiuxi337/gemma-3-12b-it-grpo") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("qiuxi337/gemma-3-12b-it-grpo") model = AutoModelForMultimodalLM.from_pretrained("qiuxi337/gemma-3-12b-it-grpo") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use qiuxi337/gemma-3-12b-it-grpo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "qiuxi337/gemma-3-12b-it-grpo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qiuxi337/gemma-3-12b-it-grpo", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/qiuxi337/gemma-3-12b-it-grpo
- SGLang
How to use qiuxi337/gemma-3-12b-it-grpo 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 "qiuxi337/gemma-3-12b-it-grpo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qiuxi337/gemma-3-12b-it-grpo", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "qiuxi337/gemma-3-12b-it-grpo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qiuxi337/gemma-3-12b-it-grpo", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use qiuxi337/gemma-3-12b-it-grpo with Docker Model Runner:
docker model run hf.co/qiuxi337/gemma-3-12b-it-grpo
Gemma-3-12B-GRPO trained with GRPO via LoRA
Due to limited available computational resources, we randomly sampled 500 data points from MedQA-USMLE using a methodology and conducted preliminary GRPO experiments with LoRA using the Unsloth framework. We are now releasing this as a preview version. More experiments and explorations are currently underway, and a technical report is in preparation. Thank you for your patience. We conduct the experiments on one RTX-A6000 Ada (48GB VRAM).
Evaluation Results
The model is evaluated on four benchmark datasets: MMLU, MMLU-Pro, CMMU, GSM8K, GPQA. The experimental results are summarized in Table 1, with comprehensive analyses provided in the Detailed Results section.
| Dataset | Gemma-3-12b-it | Gemma3-12b-GRPO |
|---|---|---|
| MMLU | 65.51 | 70.13 |
| MMLU-Pro | 60.17 | 59.99 |
| CMMLU | 54.81 | 57.07 |
| GSM8K | 91.58 | 91.81 |
| GPQA | 34.98 | 34.23 |
Requirements
pip install torch==2.6.0 torchaudio==2.6.0 torchvision==0.21.0 -i --index-url https://download.pytorch.org/whl/cu124
pip install transformer vllm bitsandbytes peft
pip install flash-attn --no-build-isolation
Run with vLLM
You can use the following script to run with vLLM.
vllm serve qiuxi337/gemma-3-12b-it-grpo \
--gpu-memory-utilization 0.85 \
--max-model-len 4096 \
--served-model-name gemma3-12b-grpo \
--api-key your_api_key
Detail Results
MMLU
Fig.1 The results on the MMLU benchmark.
Fig.2 The results on the MMLU-Humanities
Fig.3 The results on the MMLU-Social Science
Fig.4 The results on the MMLU-STEM
Fig.5 The results on the MMLU-Other
MMLU-Pro
Fig.6 The results on the MMLU-Pro
CMMLU
Fig.7 The results on the CMMLU benchmark.
Fig.8 The results on the CMMLU-Humanities
Fig.9 The results on the CMMLU-Social Science
Fig.10 The results on the CMMLU-STEM
Fig.11 The results on the CMMLU-Other
Fig.12 The results on the CMMLU-China Specific
Acknowledge
Citation
@software{Qiu_Open-Medical-R1,
author = {Qiu, Zhongxi and Zhang, Zhang and Hu, Yan and Li, Heng and Liu, Jiang},
license = {MIT},
title = {{Open-Medical-R1}},
url = {https://github.com/Qsingle/open-medical-r1},
version = {0.1}
}
- Downloads last month
- 7











