lbourdois commited on
Commit
899fa6b
·
verified ·
1 Parent(s): 28b6cfa

Improve language tag

Browse files

Hi! As the model is multilingual, this is a PR to add other languages than English to the language tag to improve the referencing. Note that 29 languages are announced in the README, but only 13 are explicitly listed. I was therefore only able to add these 13 languages.

Files changed (1) hide show
  1. README.md +121 -107
README.md CHANGED
@@ -1,108 +1,122 @@
1
- ---
2
- base_model: Qwen/Qwen2.5-32B-Instruct
3
- library_name: peft
4
- license: apache-2.0
5
- datasets:
6
- - GAIR/LIMO
7
- pipeline_tag: text-generation
8
- ---
9
-
10
- # qwen2.5-32b-instruct-limo-lora-adapter
11
-
12
- This model is a fine-tuned version of [Qwen/Qwen2.5-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-32B-Instruct) model. The fine-tuning was performed using Low-Rank Adaptation (LoRA) on the [LIMO dataset](https://huggingface.co/datasets/GAIR/LIMO) to enhance the model's reasoning capabilities, based on the work in the paper: [LIMO: Less is More for Reasoning](https://arxiv.org/pdf/2502.03387).
13
-
14
- ## Model description
15
-
16
- - **Base Model**: [Qwen/Qwen2.5-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-32B-Instruct)
17
- - **Fine-Tuning Dataset**: [GAIR/LIMO](https://huggingface.co/datasets/GAIR/LIMO)
18
- - **Fine-Tuning Method**: Low-Rank Adaptation (LoRA)
19
- - **Library Used**: [peft](https://github.com/huggingface/peft)
20
- - **License**: [Apache 2.0](LICENSE)
21
-
22
- ## Usage
23
-
24
- To utilize this model for text generation tasks, follow the steps below:
25
-
26
- ### Installation
27
-
28
- Ensure you have the necessary libraries installed:
29
-
30
- ```bash
31
- pip install torch transformers peft
32
- ```
33
-
34
- ### Generating Text
35
-
36
- ```python
37
- from transformers import AutoModelForCausalLM, AutoTokenizer
38
- from peft import PeftModel
39
- # Load the base model
40
- base_model_name = "Qwen/Qwen2.5-32B-Instruct"
41
- base_model = AutoModelForCausalLM.from_pretrained(base_model_name, torch_dtype="auto", device_map="auto")
42
- # Load the tokenizer
43
- tokenizer = AutoTokenizer.from_pretrained(base_model_name)
44
- # Load the LoRA adapter
45
- adapter_path = "t83714/qwen2.5-32b-instruct-limo-lora-adapter"
46
- model = PeftModel.from_pretrained(base_model, adapter_path)
47
- prompt = "How much is (2+5)x5/7"
48
- # Tokenize the input
49
- inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
50
- # Generate the output
51
- output = model.generate(**inputs, max_length=8000)
52
- print(tokenizer.decode(output[0], skip_special_tokens=True))
53
- ```
54
-
55
- ### Merge the adapter and export merged model
56
-
57
- ```python
58
- from peft import PeftModel
59
- from transformers import AutoModelForCausalLM
60
- base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-32B-Instruct")
61
- # Load the LoRA adapter
62
- adapter_path = "t83714/qwen2.5-32b-instruct-limo-lora-adapter"
63
- model = PeftModel.from_pretrained(base_model, adapter_path)
64
- merged_model = model.merge_and_unload()
65
- merged_model.save_pretrained("./merged-model/")
66
- ```
67
-
68
- ## Training procedure
69
-
70
- ### Training hyperparameters
71
-
72
- The following hyperparameters were used during training:
73
- - learning_rate: 5e-06
74
- - train_batch_size: 1
75
- - eval_batch_size: 8
76
- - seed: 42
77
- - distributed_type: multi-GPU
78
- - optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
79
- - generation_max_length: 16384
80
- - lr_scheduler_type: cosine
81
- - num_epochs: 15
82
- - lora rank: 8
83
- - lora target layers:
84
- - v_proj
85
- - o_proj
86
- - q_proj
87
- - k_proj
88
-
89
-
90
-
91
- ## Eval Result
92
-
93
- [Math 500](https://github.com/GAIR-NLP/LIMO/blob/main/eval/data/math/test.jsonl) pass@1: 85%
94
-
95
-
96
- ## Acknowledgment
97
- This model is trained based on the work of [Ye et al. (2025)](https://arxiv.org/abs/2502.03387). If you use this model, please also consider citing their paper:
98
- ```bibtex
99
- @misc{ye2025limoreasoning,
100
- title={LIMO: Less is More for Reasoning},
101
- author={Yixin Ye and Zhen Huang and Yang Xiao and Ethan Chern and Shijie Xia and Pengfei Liu},
102
- year={2025},
103
- eprint={2502.03387},
104
- archivePrefix={arXiv},
105
- primaryClass={cs.CL},
106
- url={https://arxiv.org/abs/2502.03387},
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  ```
 
1
+ ---
2
+ base_model: Qwen/Qwen2.5-32B-Instruct
3
+ library_name: peft
4
+ license: apache-2.0
5
+ datasets:
6
+ - GAIR/LIMO
7
+ pipeline_tag: text-generation
8
+ language:
9
+ - zho
10
+ - eng
11
+ - fra
12
+ - spa
13
+ - por
14
+ - deu
15
+ - ita
16
+ - rus
17
+ - jpn
18
+ - kor
19
+ - vie
20
+ - tha
21
+ - ara
22
+ ---
23
+
24
+ # qwen2.5-32b-instruct-limo-lora-adapter
25
+
26
+ This model is a fine-tuned version of [Qwen/Qwen2.5-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-32B-Instruct) model. The fine-tuning was performed using Low-Rank Adaptation (LoRA) on the [LIMO dataset](https://huggingface.co/datasets/GAIR/LIMO) to enhance the model's reasoning capabilities, based on the work in the paper: [LIMO: Less is More for Reasoning](https://arxiv.org/pdf/2502.03387).
27
+
28
+ ## Model description
29
+
30
+ - **Base Model**: [Qwen/Qwen2.5-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-32B-Instruct)
31
+ - **Fine-Tuning Dataset**: [GAIR/LIMO](https://huggingface.co/datasets/GAIR/LIMO)
32
+ - **Fine-Tuning Method**: Low-Rank Adaptation (LoRA)
33
+ - **Library Used**: [peft](https://github.com/huggingface/peft)
34
+ - **License**: [Apache 2.0](LICENSE)
35
+
36
+ ## Usage
37
+
38
+ To utilize this model for text generation tasks, follow the steps below:
39
+
40
+ ### Installation
41
+
42
+ Ensure you have the necessary libraries installed:
43
+
44
+ ```bash
45
+ pip install torch transformers peft
46
+ ```
47
+
48
+ ### Generating Text
49
+
50
+ ```python
51
+ from transformers import AutoModelForCausalLM, AutoTokenizer
52
+ from peft import PeftModel
53
+ # Load the base model
54
+ base_model_name = "Qwen/Qwen2.5-32B-Instruct"
55
+ base_model = AutoModelForCausalLM.from_pretrained(base_model_name, torch_dtype="auto", device_map="auto")
56
+ # Load the tokenizer
57
+ tokenizer = AutoTokenizer.from_pretrained(base_model_name)
58
+ # Load the LoRA adapter
59
+ adapter_path = "t83714/qwen2.5-32b-instruct-limo-lora-adapter"
60
+ model = PeftModel.from_pretrained(base_model, adapter_path)
61
+ prompt = "How much is (2+5)x5/7"
62
+ # Tokenize the input
63
+ inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
64
+ # Generate the output
65
+ output = model.generate(**inputs, max_length=8000)
66
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
67
+ ```
68
+
69
+ ### Merge the adapter and export merged model
70
+
71
+ ```python
72
+ from peft import PeftModel
73
+ from transformers import AutoModelForCausalLM
74
+ base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-32B-Instruct")
75
+ # Load the LoRA adapter
76
+ adapter_path = "t83714/qwen2.5-32b-instruct-limo-lora-adapter"
77
+ model = PeftModel.from_pretrained(base_model, adapter_path)
78
+ merged_model = model.merge_and_unload()
79
+ merged_model.save_pretrained("./merged-model/")
80
+ ```
81
+
82
+ ## Training procedure
83
+
84
+ ### Training hyperparameters
85
+
86
+ The following hyperparameters were used during training:
87
+ - learning_rate: 5e-06
88
+ - train_batch_size: 1
89
+ - eval_batch_size: 8
90
+ - seed: 42
91
+ - distributed_type: multi-GPU
92
+ - optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
93
+ - generation_max_length: 16384
94
+ - lr_scheduler_type: cosine
95
+ - num_epochs: 15
96
+ - lora rank: 8
97
+ - lora target layers:
98
+ - v_proj
99
+ - o_proj
100
+ - q_proj
101
+ - k_proj
102
+
103
+
104
+
105
+ ## Eval Result
106
+
107
+ [Math 500](https://github.com/GAIR-NLP/LIMO/blob/main/eval/data/math/test.jsonl) pass@1: 85%
108
+
109
+
110
+ ## Acknowledgment
111
+ This model is trained based on the work of [Ye et al. (2025)](https://arxiv.org/abs/2502.03387). If you use this model, please also consider citing their paper:
112
+ ```bibtex
113
+ @misc{ye2025limoreasoning,
114
+ title={LIMO: Less is More for Reasoning},
115
+ author={Yixin Ye and Zhen Huang and Yang Xiao and Ethan Chern and Shijie Xia and Pengfei Liu},
116
+ year={2025},
117
+ eprint={2502.03387},
118
+ archivePrefix={arXiv},
119
+ primaryClass={cs.CL},
120
+ url={https://arxiv.org/abs/2502.03387},
121
+ }
122
  ```