Instructions to use webAI-Official/math-merged-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use webAI-Official/math-merged-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B") model = PeftModel.from_pretrained(base_model, "webAI-Official/math-merged-adapter") - Transformers
How to use webAI-Official/math-merged-adapter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="webAI-Official/math-merged-adapter") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("webAI-Official/math-merged-adapter", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use webAI-Official/math-merged-adapter with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "webAI-Official/math-merged-adapter" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "webAI-Official/math-merged-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/webAI-Official/math-merged-adapter
- SGLang
How to use webAI-Official/math-merged-adapter 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 "webAI-Official/math-merged-adapter" \ --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": "webAI-Official/math-merged-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "webAI-Official/math-merged-adapter" \ --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": "webAI-Official/math-merged-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use webAI-Official/math-merged-adapter with Docker Model Runner:
docker model run hf.co/webAI-Official/math-merged-adapter
File size: 1,211 Bytes
8d1e8df c25fe69 8d1e8df | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ---
base_model: Qwen/Qwen3-4B
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:Qwen/Qwen3-4B
- sft
- grpo
- lora
- transformers
- trl
---
# Combined SFT + GRPO LoRA Adapter for Qwen3-4B
This adapter combines two LoRA training stages into a single adapter:
1. **SFT** (Supervised Fine-Tuning) on Qwen/Qwen3-4B
2. **GRPO** (Group Relative Policy Optimization) on the SFT model
The two rank-32 adapters were merged into a single **rank-64** adapter (lossless).
Apply directly to `Qwen/Qwen3-4B` — no intermediate merged model needed.
## Usage
```python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B")
model = PeftModel.from_pretrained(base_model, "abdul-hannan/qwen3-math-grpo")
tokenizer = AutoTokenizer.from_pretrained("abdul-hannan/qwen3-math-grpo")
```
## Training Details
- **Base model:** Qwen/Qwen3-4B
- **LoRA rank:** 64 (combined from two rank-32 adapters)
- **LoRA alpha:** 128
- **Target modules:** q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- **PEFT version:** 0.18.1
### Contact
Syed Abdul Hannan
### Framework versions
- PEFT 0.18.1
|