Files changed (1) hide show
  1. README.md +172 -160
README.md CHANGED
@@ -1,161 +1,173 @@
1
- ---
2
- license: mit
3
- datasets:
4
- - openai/gsm8k
5
- - eagle0504/openai-gsm8k-enhanced-using-together-ai-deepseek-train8k-test1k-v1
6
- language:
7
- - en
8
- base_model:
9
- - Qwen/Qwen2.5-3B-Instruct
10
- library_name: transformers
11
- tags:
12
- - fine-tuned
13
- - qwen
14
- - deepseek
15
- - gsm8k
16
- - reasoning
17
- ---
18
-
19
- # Qwen 2.5-3B-Instruct Fine-Tuned on OpenAI GSM8K with DeepSeek Augmentation
20
-
21
- ## Model Overview
22
-
23
- This model is a fine-tuned version of **Qwen/Qwen2.5-3B-Instruct**, optimized for mathematical reasoning tasks using the **OpenAI GSM8K** dataset. The fine-tuning process enhances the model's ability to generate step-by-step explanations for grade school math problems, incorporating **reasoning augmentation** through DeepSeek. The model improves upon GSM8K’s standard answers by integrating additional contextual reasoning derived from DeepSeek’s small model.
24
-
25
- ### Key Features:
26
- - **Base Model**: Qwen 2.5-3B-Instruct
27
- - **Fine-Tuned On**: OpenAI GSM8K dataset
28
- - **Enhancement**: Answer augmentation with reasoning insights from **DeepSeek-V3-Small**
29
- - **Improved Reasoning**: Model not only provides correct answers but also **augments** explanations with logical steps inspired by DeepSeek’s generative capabilities.
30
-
31
- ## Dataset & Training Details
32
-
33
- - **Dataset**: OpenAI’s GSM8K (Grade School Math 8K), a collection of high-quality math problems designed to test problem-solving skills.
34
- - **Data Curation**: We have provided enhanced OpenAI's GSM8K dataset with reasoning skills generated using DeepSeek-R1, see [here](https://huggingface.co/datasets/eagle0504/openai-gsm8k-enhanced-using-together-ai-deepseek-train8k-test1k-v1).
35
- - **Enhancement**: After fine-tuning on GSM8K, additional reasoning layers were introduced using **DeepSeek-V3-Small**, leading to richer, more interpretable answers.
36
- - **Training Objective**: Improve step-by-step mathematical reasoning and **enhance logical deductions** in model-generated responses.
37
-
38
- I have adopted some code from Unsloth and here's an updated [notebook](https://colab.research.google.com/drive/1HV0YkyiTD55j1xLRBHwJ_q3ex82W5EXr?usp=sharing) on Colab. Please feel free to copy it and run it yourself.
39
-
40
- You will need:
41
- - Huggingface token
42
- - Together.AI API Key
43
- - Unsloth package
44
-
45
- ## How to Use Model via Terminal (Mac)
46
-
47
- **Goal** Run Qwen-2.5-3B Instruct on Your Mac Using `llama.cpp`
48
-
49
- Yes! You can run **Qwen-2.5-3B Instruct** on your Mac using `llama.cpp`. Here’s a step-by-step guide assuming you are starting from a clean macOS installation with only `pyenv` installed.
50
-
51
- ### **Step 1: Install Homebrew (if not installed)**
52
- Homebrew is required to install `llama.cpp`.
53
-
54
- 1. Open **Terminal** (`Cmd + Space`, type `Terminal`, and press **Enter**).
55
- 2. Run:
56
- ```sh
57
- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
58
- ```
59
- 3. After installation, add Homebrew to your PATH:
60
- ```sh
61
- echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
62
- eval "$(/opt/homebrew/bin/brew shellenv)"
63
- ```
64
-
65
- ---
66
-
67
- ### **Step 2: Install `llama.cpp` via Homebrew**
68
- Run:
69
- ```sh
70
- brew install llama.cpp
71
- ```
72
-
73
- Once installed, you should be able to use `llama-cli`.
74
-
75
- ---
76
-
77
- ### **Step 3: Run Qwen-2.5-3B Instruct with `llama-cli`**
78
- To run the model, execute:
79
- ```sh
80
- llama-cli -hf eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3:Q8_0
81
- ```
82
-
83
- ---
84
-
85
- ### **Step 4: Additional Configurations (If Needed)**
86
- If you encounter issues or need finer control, you may want to:
87
-
88
- #### **A. Verify Installation**
89
- Check if `llama-cli` is installed:
90
- ```sh
91
- llama-cli --version
92
- ```
93
- If you see a version output, it’s installed correctly.
94
-
95
- #### **B. Run with Explicit Model Path**
96
- If the default Hugging Face loader doesn't work, you can manually download the model:
97
- 1. **Create a models directory:**
98
- ```sh
99
- mkdir -p ~/llama_models && cd ~/llama_models
100
- ```
101
- 2. **Download the GGUF model file** from [Hugging Face](https://huggingface.co/eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3):
102
- ```sh
103
- wget https://huggingface.co/eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3/blob/main/unsloth.Q8_0.gguf
104
- ```
105
- 3. **Run the model manually**:
106
- ```sh
107
- llama-cli -m ~/llama_models/Q8_0.gguf
108
- ```
109
-
110
- ---
111
-
112
- ### **Step 5: Test the Model**
113
- Try prompting it:
114
- ```sh
115
- llama-cli -m ~/llama_models/Q8_0.gguf -p "Explain quantum computing in simple terms."
116
- ```
117
- or interactively:
118
- ```sh
119
- llama-cli -m ~/llama_models/Q8_0.gguf --interactive
120
- ```
121
-
122
- ## How to Use Model via Python
123
-
124
- You can load this model with `transformers`:
125
-
126
- ```python
127
- from transformers import AutoModelForCausalLM, AutoTokenizer
128
-
129
- model_name = "eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3"
130
-
131
- tokenizer = AutoTokenizer.from_pretrained(model_name)
132
- model = AutoModelForCausalLM.from_pretrained(model_name)
133
-
134
- # Example prompt
135
- prompt = "A farmer has 24 apples. He gives 6 to each of his 3 children. How many does he have left?"
136
- inputs = tokenizer(prompt, return_tensors="pt")
137
- output = model.generate(**inputs, max_length=200)
138
- print(tokenizer.decode(output[0], skip_special_tokens=True))
139
- ```
140
-
141
- ## Expected Performance
142
-
143
- Compared to the base **Qwen2.5-3B-Instruct**, this fine-tuned model:
144
- - Provides **more detailed explanations** when answering GSM8K math problems.
145
- - Improves **logical reasoning** by incorporating DeepSeek-style augmented reasoning.
146
- - Generates **clearer step-by-step solutions**, making it useful for educational or tutoring applications.
147
-
148
- ## Model Directory
149
-
150
- The model is hosted on **Hugging Face Hub**:
151
- 👉 **[eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3](https://huggingface.co/eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3)**
152
-
153
- ## License
154
-
155
- This model is released under the **MIT License**, allowing open usage and modifications.
156
-
157
- ---
158
-
159
- If you have any questions or suggestions for improvements, feel free to reach out!
160
-
 
 
 
 
 
 
 
 
 
 
 
 
161
  🔗 [LinkedIn](https://www.linkedin.com/in/yiqiaoyin/)
 
1
+ ---
2
+ license: mit
3
+ datasets:
4
+ - openai/gsm8k
5
+ - eagle0504/openai-gsm8k-enhanced-using-together-ai-deepseek-train8k-test1k-v1
6
+ language:
7
+ - zho
8
+ - eng
9
+ - fra
10
+ - spa
11
+ - por
12
+ - deu
13
+ - ita
14
+ - rus
15
+ - jpn
16
+ - kor
17
+ - vie
18
+ - tha
19
+ - ara
20
+ base_model:
21
+ - Qwen/Qwen2.5-3B-Instruct
22
+ library_name: transformers
23
+ tags:
24
+ - fine-tuned
25
+ - qwen
26
+ - deepseek
27
+ - gsm8k
28
+ - reasoning
29
+ ---
30
+
31
+ # Qwen 2.5-3B-Instruct Fine-Tuned on OpenAI GSM8K with DeepSeek Augmentation
32
+
33
+ ## Model Overview
34
+
35
+ This model is a fine-tuned version of **Qwen/Qwen2.5-3B-Instruct**, optimized for mathematical reasoning tasks using the **OpenAI GSM8K** dataset. The fine-tuning process enhances the model's ability to generate step-by-step explanations for grade school math problems, incorporating **reasoning augmentation** through DeepSeek. The model improves upon GSM8K’s standard answers by integrating additional contextual reasoning derived from DeepSeek’s small model.
36
+
37
+ ### Key Features:
38
+ - **Base Model**: Qwen 2.5-3B-Instruct
39
+ - **Fine-Tuned On**: OpenAI GSM8K dataset
40
+ - **Enhancement**: Answer augmentation with reasoning insights from **DeepSeek-V3-Small**
41
+ - **Improved Reasoning**: Model not only provides correct answers but also **augments** explanations with logical steps inspired by DeepSeek’s generative capabilities.
42
+
43
+ ## Dataset & Training Details
44
+
45
+ - **Dataset**: OpenAI’s GSM8K (Grade School Math 8K), a collection of high-quality math problems designed to test problem-solving skills.
46
+ - **Data Curation**: We have provided enhanced OpenAI's GSM8K dataset with reasoning skills generated using DeepSeek-R1, see [here](https://huggingface.co/datasets/eagle0504/openai-gsm8k-enhanced-using-together-ai-deepseek-train8k-test1k-v1).
47
+ - **Enhancement**: After fine-tuning on GSM8K, additional reasoning layers were introduced using **DeepSeek-V3-Small**, leading to richer, more interpretable answers.
48
+ - **Training Objective**: Improve step-by-step mathematical reasoning and **enhance logical deductions** in model-generated responses.
49
+
50
+ I have adopted some code from Unsloth and here's an updated [notebook](https://colab.research.google.com/drive/1HV0YkyiTD55j1xLRBHwJ_q3ex82W5EXr?usp=sharing) on Colab. Please feel free to copy it and run it yourself.
51
+
52
+ You will need:
53
+ - Huggingface token
54
+ - Together.AI API Key
55
+ - Unsloth package
56
+
57
+ ## How to Use Model via Terminal (Mac)
58
+
59
+ **Goal** Run Qwen-2.5-3B Instruct on Your Mac Using `llama.cpp`
60
+
61
+ Yes! You can run **Qwen-2.5-3B Instruct** on your Mac using `llama.cpp`. Here’s a step-by-step guide assuming you are starting from a clean macOS installation with only `pyenv` installed.
62
+
63
+ ### **Step 1: Install Homebrew (if not installed)**
64
+ Homebrew is required to install `llama.cpp`.
65
+
66
+ 1. Open **Terminal** (`Cmd + Space`, type `Terminal`, and press **Enter**).
67
+ 2. Run:
68
+ ```sh
69
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
70
+ ```
71
+ 3. After installation, add Homebrew to your PATH:
72
+ ```sh
73
+ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
74
+ eval "$(/opt/homebrew/bin/brew shellenv)"
75
+ ```
76
+
77
+ ---
78
+
79
+ ### **Step 2: Install `llama.cpp` via Homebrew**
80
+ Run:
81
+ ```sh
82
+ brew install llama.cpp
83
+ ```
84
+
85
+ Once installed, you should be able to use `llama-cli`.
86
+
87
+ ---
88
+
89
+ ### **Step 3: Run Qwen-2.5-3B Instruct with `llama-cli`**
90
+ To run the model, execute:
91
+ ```sh
92
+ llama-cli -hf eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3:Q8_0
93
+ ```
94
+
95
+ ---
96
+
97
+ ### **Step 4: Additional Configurations (If Needed)**
98
+ If you encounter issues or need finer control, you may want to:
99
+
100
+ #### **A. Verify Installation**
101
+ Check if `llama-cli` is installed:
102
+ ```sh
103
+ llama-cli --version
104
+ ```
105
+ If you see a version output, it’s installed correctly.
106
+
107
+ #### **B. Run with Explicit Model Path**
108
+ If the default Hugging Face loader doesn't work, you can manually download the model:
109
+ 1. **Create a models directory:**
110
+ ```sh
111
+ mkdir -p ~/llama_models && cd ~/llama_models
112
+ ```
113
+ 2. **Download the GGUF model file** from [Hugging Face](https://huggingface.co/eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3):
114
+ ```sh
115
+ wget https://huggingface.co/eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3/blob/main/unsloth.Q8_0.gguf
116
+ ```
117
+ 3. **Run the model manually**:
118
+ ```sh
119
+ llama-cli -m ~/llama_models/Q8_0.gguf
120
+ ```
121
+
122
+ ---
123
+
124
+ ### **Step 5: Test the Model**
125
+ Try prompting it:
126
+ ```sh
127
+ llama-cli -m ~/llama_models/Q8_0.gguf -p "Explain quantum computing in simple terms."
128
+ ```
129
+ or interactively:
130
+ ```sh
131
+ llama-cli -m ~/llama_models/Q8_0.gguf --interactive
132
+ ```
133
+
134
+ ## How to Use Model via Python
135
+
136
+ You can load this model with `transformers`:
137
+
138
+ ```python
139
+ from transformers import AutoModelForCausalLM, AutoTokenizer
140
+
141
+ model_name = "eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3"
142
+
143
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
144
+ model = AutoModelForCausalLM.from_pretrained(model_name)
145
+
146
+ # Example prompt
147
+ prompt = "A farmer has 24 apples. He gives 6 to each of his 3 children. How many does he have left?"
148
+ inputs = tokenizer(prompt, return_tensors="pt")
149
+ output = model.generate(**inputs, max_length=200)
150
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
151
+ ```
152
+
153
+ ## Expected Performance
154
+
155
+ Compared to the base **Qwen2.5-3B-Instruct**, this fine-tuned model:
156
+ - Provides **more detailed explanations** when answering GSM8K math problems.
157
+ - Improves **logical reasoning** by incorporating DeepSeek-style augmented reasoning.
158
+ - Generates **clearer step-by-step solutions**, making it useful for educational or tutoring applications.
159
+
160
+ ## Model Directory
161
+
162
+ The model is hosted on **Hugging Face Hub**:
163
+ 👉 **[eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3](https://huggingface.co/eagle0504/qwen-2-5-3b-instruct-using-openai-gsm8k-data-enhanced-with-deepseek-v3)**
164
+
165
+ ## License
166
+
167
+ This model is released under the **MIT License**, allowing open usage and modifications.
168
+
169
+ ---
170
+
171
+ If you have any questions or suggestions for improvements, feel free to reach out!
172
+
173
  🔗 [LinkedIn](https://www.linkedin.com/in/yiqiaoyin/)