loubnabnl HF staff commited on
Commit
b2b9f2f
·
verified ·
1 Parent(s): dd154b9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -36
README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
- datasets: open-r1/numina-ALL-V4-verify-s1k
3
  library_name: transformers
4
- model_name: R2-Q7B-GR1-ALL-s1k-5e-5-weight-decay-1e-4
5
  tags:
6
  - generated_from_trainer
7
  - trl
@@ -9,50 +9,41 @@ tags:
9
  licence: license
10
  ---
11
 
12
- # Model Card for R2-Q7B-GR1-ALL-s1k-5e-5-weight-decay-1e-4
13
 
14
- This model is a fine-tuned version of [None](https://huggingface.co/None) on the [open-r1/numina-ALL-V4-verify-s1k](https://huggingface.co/datasets/open-r1/numina-ALL-V4-verify-s1k) dataset.
15
- It has been trained using [TRL](https://github.com/huggingface/trl).
16
 
17
  ## Quick start
18
 
19
  ```python
20
- from transformers import pipeline
21
 
22
- question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
23
- generator = pipeline("text-generation", model="HuggingFaceH4/R2-Q7B-GR1-ALL-s1k-5e-5-weight-decay-1e-4", device="cuda")
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
- This model was trained with SFT.
34
 
35
- ### Framework versions
36
-
37
- - TRL: 0.15.0.dev0
38
- - Transformers: 4.49.0.dev0
39
- - Pytorch: 2.5.1+cu121
40
- - Datasets: 3.2.0
41
- - Tokenizers: 0.21.0
42
 
43
- ## Citations
44
 
 
45
 
 
46
 
47
- Cite TRL as:
48
-
49
- ```bibtex
50
- @misc{vonwerra2022trl,
51
- title = {{TRL: Transformer Reinforcement Learning}},
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 |