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