BytedTsinghua-SIA/DAPO-Math-17k
Viewer • Updated • 1.79M • 11.1k • 172
How to use caiyuchen/DAPO-step-27 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="caiyuchen/DAPO-step-27")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("caiyuchen/DAPO-step-27")
model = AutoModelForCausalLM.from_pretrained("caiyuchen/DAPO-step-27")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use caiyuchen/DAPO-step-27 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "caiyuchen/DAPO-step-27"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "caiyuchen/DAPO-step-27",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/caiyuchen/DAPO-step-27
How to use caiyuchen/DAPO-step-27 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "caiyuchen/DAPO-step-27" \
--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": "caiyuchen/DAPO-step-27",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "caiyuchen/DAPO-step-27" \
--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": "caiyuchen/DAPO-step-27",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use caiyuchen/DAPO-step-27 with Docker Model Runner:
docker model run hf.co/caiyuchen/DAPO-step-27
During Inference, each question is formatted as:
{question} Please reason step by step, and put your final answer within boxed{}.
Then wrapped using the chat template:
prompt = tokenizer.apply_chat_template(
[{{"content": question_with_instruction, "role": "user"}}],
tokenize=False,
add_generation_prompt=True,
)
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("caiyuchen/DAPO-step-27")
tokenizer = AutoTokenizer.from_pretrained("caiyuchen/DAPO-step-27")
question = "Convert the point $(0,3)$ in rectangular coordinates to polar coordinates. Enter your answer in the form $(r,\theta),$ where $r > 0$ and $0 \le \theta < 2 \pi.$"
question_with_instruction = question + "
Please reason step by step, and put your final answer within \boxed{{}}"
# Apply chat template
prompt = tokenizer.apply_chat_template(
[{{"content": question_with_instruction, "role": "user"}}],
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
If you find this model useful, please consider citing our paper:
🔗 Paper Link: https://huggingface.co/papers/2510.00553
@misc{cai2025predictabilityreinforcementlearningdynamics,
title={On Predictability of Reinforcement Learning Dynamics for Large Language Models},
author={Yuchen Cai and Ding Cao and Xin Xu and Zijun Yao and Yuqing Huang and Zhenyu Tan and Benyi Zhang and Guiquan Liu and Junfeng Fang},
year={2025},
eprint={2510.00553},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2510.00553},
}
Base model
Qwen/Qwen3-8B-Base