Update README.md
Browse files
README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
---
|
2 |
-
datasets: open-r1/
|
3 |
library_name: transformers
|
4 |
-
model_name:
|
5 |
tags:
|
6 |
- generated_from_trainer
|
7 |
- trl
|
@@ -9,50 +9,41 @@ tags:
|
|
9 |
licence: license
|
10 |
---
|
11 |
|
12 |
-
#
|
13 |
|
14 |
-
This
|
15 |
-
It has been trained using [TRL](https://github.com/huggingface/trl).
|
16 |
|
17 |
## Quick start
|
18 |
|
19 |
```python
|
20 |
-
from transformers import
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
25 |
-
print(output["generated_text"])
|
26 |
-
```
|
27 |
-
|
28 |
-
## Training procedure
|
29 |
-
|
30 |
-
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/eliebak/huggingface/runs/e4oglhrp)
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
- Datasets: 3.2.0
|
41 |
-
- Tokenizers: 0.21.0
|
42 |
|
43 |
-
##
|
44 |
|
|
|
45 |
|
|
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
|
53 |
-
year = 2020,
|
54 |
-
journal = {GitHub repository},
|
55 |
-
publisher = {GitHub},
|
56 |
-
howpublished = {\url{https://github.com/huggingface/trl}}
|
57 |
-
}
|
58 |
-
```
|
|
|
1 |
---
|
2 |
+
datasets: open-r1/openr1-220k-math
|
3 |
library_name: transformers
|
4 |
+
model_name: OpenR1-Qwen-7B
|
5 |
tags:
|
6 |
- generated_from_trainer
|
7 |
- trl
|
|
|
9 |
licence: license
|
10 |
---
|
11 |
|
12 |
+
# OpenR1-Qwen-7B
|
13 |
|
14 |
+
This is a finetune of [Qwen2.5-Math-Instruct](https://huggingface.co/Qwen/Qwen2.5-Math-7B-Instruct) on [OpenR1-220k-Math](https://huggingface.co/datasets/open-r1/openr1-220k-math) (`default` split).
|
|
|
15 |
|
16 |
## Quick start
|
17 |
|
18 |
```python
|
19 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
20 |
|
21 |
+
model_name = "open-r1/OpenR1-Qwen-7B"
|
22 |
+
device = "cuda"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
model = AutoModelForCausalLM.from_pretrained(
|
25 |
+
model_name,
|
26 |
+
torch_dtype="auto",
|
27 |
+
device_map="auto"
|
28 |
+
)
|
29 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
30 |
|
31 |
+
prompt = "Find the value of $x$ that satisfies the equation $4x+5 = 6x+7$."
|
32 |
|
33 |
+
messages = [
|
34 |
+
{"role": "system", "content": "Please reason step by step, and put your final answer within \\boxed{}."},
|
35 |
+
{"role": "user", "content": prompt}
|
36 |
+
]
|
37 |
+
```
|
|
|
|
|
38 |
|
39 |
+
## Training
|
40 |
|
41 |
+
We train the model on the `default` split of [OpenR1-220k-Math](https://huggingface.co/datasets/open-r1/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-Distill-Qwen-7B and OpenThinker-7B using [lighteval](https://github.com/huggingface/open-r1/tree/main?tab=readme-ov-file#evaluating-models).
|
42 |
|
43 |
+
You can find the training and evaluation code at: https://github.com/huggingface/open-r1/
|
44 |
|
45 |
+
| Model | MATH-500 | AIME24 |
|
46 |
+
| --- | --- | --- |
|
47 |
+
| DeepSeek-Distill-Qwen-7B | 91.8 | 53.3 |
|
48 |
+
| OpenR1-Qwen-7B | 91.0 | 53.3 |
|
49 |
+
| OpenThinker-7B | 85.4 | 30.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|