pngwn HF Staff commited on
Commit
8b11d32
·
verified ·
1 Parent(s): 0106167

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +24 -69
README.md CHANGED
@@ -1,80 +1,35 @@
1
  ---
2
- base_model: Qwen/Qwen2.5-0.5B
3
- library_name: transformers
4
- model_name: qwen2.5-0.5b-gsm8k-sft
5
  tags:
6
- - generated_from_trainer
7
- - trl
8
- - hf_jobs
9
- - sft
10
- - ml-intern
11
- licence: license
12
  ---
13
 
14
- # Model Card for qwen2.5-0.5b-gsm8k-sft
15
-
16
- This model is a fine-tuned version of [Qwen/Qwen2.5-0.5B](https://huggingface.co/Qwen/Qwen2.5-0.5B).
17
- It has been trained using [TRL](https://github.com/huggingface/trl).
18
-
19
- ## Quick start
20
-
21
- ```python
22
- from transformers import pipeline
23
-
24
- 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?"
25
- generator = pipeline("text-generation", model="pngwn/qwen2.5-0.5b-gsm8k-sft", device="cuda")
26
- output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
27
- print(output["generated_text"])
28
- ```
29
-
30
- ## Training procedure
31
-
32
-
33
-
34
-
35
-
36
- This model was trained with SFT.
37
-
38
- ### Framework versions
39
-
40
- - TRL: 1.5.1
41
- - Transformers: 5.10.2
42
- - Pytorch: 2.12.0
43
- - Datasets: 5.0.0
44
- - Tokenizers: 0.22.2
45
-
46
- ## Citations
47
-
48
-
49
-
50
- Cite TRL as:
51
-
52
- ```bibtex
53
- @software{vonwerra2020trl,
54
- title = {{TRL: Transformers Reinforcement Learning}},
55
- author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
56
- license = {Apache-2.0},
57
- url = {https://github.com/huggingface/trl},
58
- year = {2020}
59
- }
60
- ```
61
 
62
- <!-- ml-intern-provenance -->
63
- ## Generated by ML Intern
64
 
65
- This model repository was generated by [ML Intern](https://github.com/huggingface/ml-intern), an agent for machine learning research and development on the Hugging Face Hub.
66
 
67
- - Try ML Intern: https://smolagents-ml-intern.hf.space
68
- - Source code: https://github.com/huggingface/ml-intern
 
 
69
 
70
- ## Usage
71
 
72
- ```python
73
- from transformers import AutoModelForCausalLM, AutoTokenizer
 
 
 
 
 
 
 
 
74
 
75
- model_id = 'pngwn/qwen2.5-0.5b-gsm8k-sft'
76
- tokenizer = AutoTokenizer.from_pretrained(model_id)
77
- model = AutoModelForCausalLM.from_pretrained(model_id)
78
- ```
79
 
80
- For non-causal architectures, replace `AutoModelForCausalLM` with the appropriate `AutoModel` class.
 
1
  ---
 
 
 
2
  tags:
3
+ - sft
4
+ - gsm8k
5
+ - math
6
+ base_model: Qwen/Qwen2.5-0.5B
 
 
7
  ---
8
 
9
+ # Qwen2.5-0.5B GSM8K SFT
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ Supervised fine-tuned model for grade-school math reasoning on GSM8K.
 
12
 
13
+ ## Results
14
 
15
+ | Model | GSM8K test exact-match accuracy | N eval |
16
+ |-------|-----------------------------------|--------|
17
+ | Base (Qwen/Qwen2.5-0.5B) | 0.0008 (1/1319) | 1319 |
18
+ | Tuned (pngwn/qwen2.5-0.5b-gsm8k-sft) | 0.3472 (458/1319) | 1319 |
19
 
20
+ ## Training details
21
 
22
+ - **Dataset:** openai/gsm8k (main config)
23
+ - **Train split:** 7473 samples
24
+ - **Test split:** 1319 samples
25
+ - **Epochs:** 3
26
+ - **Learning rate:** 2e-5
27
+ - **Batch size:** 4 per device
28
+ - **Gradient accumulation:** 4
29
+ - **Max sequence length:** 1024
30
+ - **Decoding:** greedy (do_sample=False, max_new_tokens=256)
31
+ - **Answer extraction:** regex `####\s*(-?\d+(?:,\d+)*(?:\.\d+)?)`
32
 
33
+ ## Eval script
 
 
 
34
 
35
+ The exact eval script used for both baseline and tuned evaluation is included in this repository as `eval_gsm8k.py`.