1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "open-r1/OpenR1-Qwen-7B"
4device = "cuda"
5
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 torch_dtype="auto",
9 device_map="auto"
10)
11tokenizer = AutoTokenizer.from_pretrained(model_name)
12
13prompt = "Find the value of $x$ that satisfies the equation $4x+5 = 6x+7$."
14
15messages = [
16 {"role": "system", "content": "Please reason step by step, and put your final answer within \\boxed{}."},
17 {"role": "user", "content": prompt}
18]
We train the model on the
default split of
OpenR1-220k-Math for 3 epochs. We use learning rate of 5e-5 and extend the context length from 4k to 32k, by increasing RoPE frequency to 300k. The training follows a linear learning rate schedule with a 10% warmup phase. The table below compares the performance of OpenR1-Qwen-7B to
DeepSeek-R1-Distill-Qwen-7B and
OpenThinker-7B using
lighteval.
You can find the training and evaluation code at:
https://github.com/huggingface/open-r1/