Update README.md
Browse files
README.md
CHANGED
@@ -4,199 +4,189 @@ tags:
|
|
4 |
- unsloth
|
5 |
- trl
|
6 |
- grpo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
---
|
8 |
|
9 |
-
#
|
10 |
|
11 |
-
|
12 |
|
|
|
13 |
|
|
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
<!-- Provide a longer summary of what this model is. -->
|
20 |
-
|
21 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
22 |
-
|
23 |
-
- **Developed by:** [More Information Needed]
|
24 |
-
- **Funded by [optional]:** [More Information Needed]
|
25 |
-
- **Shared by [optional]:** [More Information Needed]
|
26 |
-
- **Model type:** [More Information Needed]
|
27 |
-
- **Language(s) (NLP):** [More Information Needed]
|
28 |
-
- **License:** [More Information Needed]
|
29 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
30 |
-
|
31 |
-
### Model Sources [optional]
|
32 |
-
|
33 |
-
<!-- Provide the basic links for the model. -->
|
34 |
-
|
35 |
-
- **Repository:** [More Information Needed]
|
36 |
-
- **Paper [optional]:** [More Information Needed]
|
37 |
-
- **Demo [optional]:** [More Information Needed]
|
38 |
-
|
39 |
-
## Uses
|
40 |
-
|
41 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
42 |
-
|
43 |
-
### Direct Use
|
44 |
-
|
45 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
46 |
-
|
47 |
-
[More Information Needed]
|
48 |
-
|
49 |
-
### Downstream Use [optional]
|
50 |
-
|
51 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
52 |
-
|
53 |
-
[More Information Needed]
|
54 |
-
|
55 |
-
### Out-of-Scope Use
|
56 |
-
|
57 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
58 |
-
|
59 |
-
[More Information Needed]
|
60 |
-
|
61 |
-
## Bias, Risks, and Limitations
|
62 |
-
|
63 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
64 |
-
|
65 |
-
[More Information Needed]
|
66 |
-
|
67 |
-
### Recommendations
|
68 |
-
|
69 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
70 |
-
|
71 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
72 |
-
|
73 |
-
## How to Get Started with the Model
|
74 |
-
|
75 |
-
Use the code below to get started with the model.
|
76 |
-
|
77 |
-
[More Information Needed]
|
78 |
-
|
79 |
-
## Training Details
|
80 |
-
|
81 |
-
### Training Data
|
82 |
-
|
83 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
84 |
-
|
85 |
-
[More Information Needed]
|
86 |
-
|
87 |
-
### Training Procedure
|
88 |
-
|
89 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
90 |
-
|
91 |
-
#### Preprocessing [optional]
|
92 |
-
|
93 |
-
[More Information Needed]
|
94 |
-
|
95 |
-
|
96 |
-
#### Training Hyperparameters
|
97 |
-
|
98 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
99 |
-
|
100 |
-
#### Speeds, Sizes, Times [optional]
|
101 |
-
|
102 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
103 |
-
|
104 |
-
[More Information Needed]
|
105 |
-
|
106 |
-
## Evaluation
|
107 |
-
|
108 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
109 |
-
|
110 |
-
### Testing Data, Factors & Metrics
|
111 |
-
|
112 |
-
#### Testing Data
|
113 |
-
|
114 |
-
<!-- This should link to a Dataset Card if possible. -->
|
115 |
-
|
116 |
-
[More Information Needed]
|
117 |
-
|
118 |
-
#### Factors
|
119 |
-
|
120 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
121 |
|
122 |
-
|
123 |
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
-
|
|
|
127 |
|
128 |
-
|
129 |
|
130 |
-
|
131 |
|
132 |
-
|
|
|
133 |
|
134 |
-
|
|
|
|
|
135 |
|
|
|
|
|
|
|
|
|
136 |
|
|
|
|
|
|
|
137 |
|
138 |
-
|
|
|
|
|
|
|
139 |
|
140 |
-
|
|
|
|
|
141 |
|
142 |
-
|
143 |
|
144 |
-
##
|
145 |
|
146 |
-
|
147 |
|
148 |
-
|
|
|
|
|
|
|
149 |
|
150 |
-
|
151 |
-
|
152 |
-
-
|
153 |
-
-
|
154 |
-
|
155 |
|
156 |
-
|
|
|
|
|
|
|
157 |
|
158 |
-
###
|
|
|
|
|
|
|
159 |
|
160 |
-
|
161 |
|
162 |
-
|
163 |
|
164 |
-
|
|
|
|
|
165 |
|
166 |
-
|
|
|
|
|
|
|
167 |
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
-
|
171 |
|
172 |
-
|
173 |
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
-
|
|
|
177 |
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
-
|
181 |
|
182 |
-
**
|
|
|
|
|
|
|
|
|
183 |
|
184 |
-
|
|
|
|
|
185 |
|
186 |
-
|
187 |
|
188 |
-
|
|
|
|
|
|
|
|
|
189 |
|
190 |
-
|
191 |
|
192 |
-
##
|
|
|
193 |
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
-
|
197 |
|
198 |
-
|
|
|
199 |
|
200 |
-
|
201 |
|
202 |
-
|
|
|
4 |
- unsloth
|
5 |
- trl
|
6 |
- grpo
|
7 |
+
license: mit
|
8 |
+
datasets:
|
9 |
+
- eagle0504/openai-gsm8k-enhanced-using-together-ai-deepseek-train8k-test1k-v1
|
10 |
+
language:
|
11 |
+
- en
|
12 |
+
base_model:
|
13 |
+
- Qwen/Qwen2.5-1.5B-Instruct
|
14 |
---
|
15 |
|
16 |
+
# Qwen2.5-1.5B-Instruct Fine-Tuned on GSM8K with DeepSeek Augmentation
|
17 |
|
18 |
+
## 🚀 Model Overview
|
19 |
|
20 |
+
This model is a **fine-tuned version of Qwen2.5-1.5B-Instruct**, optimized for **mathematical problem-solving with step-by-step reasoning**. It was trained on the **GSM8K dataset**, incorporating **Chain-of-Thought (CoT) reasoning** using **DeepSeek augmentation**.
|
21 |
|
22 |
+
The model is designed to provide **logical, structured, and interpretable answers**, making it ideal for applications in **education, tutoring, and automated reasoning**.
|
23 |
|
24 |
+
### 🔹 **Key Features**
|
25 |
+
- **Base Model:** `Qwen/Qwen2.5-1.5B-Instruct`
|
26 |
+
- **Fine-Tuned On:** `eagle0504/openai-gsm8k-enhanced-using-together-ai-deepseek-train8k-test1k-v1`
|
27 |
+
- **Optimized for:** **Mathematical problem-solving & step-by-step logical reasoning**
|
28 |
+
- **Fine-tuned with:** **LoRA (Low-Rank Adaptation) for efficient memory usage**
|
29 |
+
- **Inference-ready:** Available on **🤗 Hugging Face** and **compatible with `llama.cpp`**
|
30 |
+
- **Supports GGUF:** Optimized versions for **Q4_K_M, Q8_0, Q5_K_M, and FP16**
|
31 |
|
32 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
+
## 📂 **Model Details**
|
35 |
|
36 |
+
- **Developed by:** [Your Name or Organization]
|
37 |
+
- **Model Type:** Causal Language Model (**Text Generation**)
|
38 |
+
- **Languages:** English (`en`)
|
39 |
+
- **License:** MIT License
|
40 |
+
- **Fine-tuned from:** `Qwen/Qwen2.5-1.5B-Instruct`
|
41 |
+
- **Training Library:** `transformers` + `unsloth` + `trl`
|
42 |
+
- **Quantization:** GGUF (`Q4_K_M, Q8_0, Q5_K_M, f16`)
|
43 |
|
44 |
+
🔗 **Hugging Face Repository**:
|
45 |
+
👉 [Fine-tuned Qwen2.5-1.5B-Instruct](https://huggingface.co/your-repo-id)
|
46 |
|
47 |
+
---
|
48 |
|
49 |
+
## 🛠 How to Use the Model
|
50 |
|
51 |
+
### **Using `transformers` in Python**
|
52 |
+
You can load and use the model with 🤗 `transformers` as follows:
|
53 |
|
54 |
+
```python
|
55 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
56 |
+
import torch
|
57 |
|
58 |
+
# Load model and tokenizer
|
59 |
+
model_name = "your-repo-id"
|
60 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
61 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
62 |
|
63 |
+
# Move model to GPU if available
|
64 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
65 |
+
model.to(device)
|
66 |
|
67 |
+
# Example inference
|
68 |
+
question = "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?"
|
69 |
+
inputs = tokenizer(question, return_tensors="pt").to(device)
|
70 |
+
output = model.generate(**inputs, max_length=200)
|
71 |
|
72 |
+
# Decode response
|
73 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
74 |
+
```
|
75 |
|
76 |
+
---
|
77 |
|
78 |
+
## 🖥️ Running the Model with `llama.cpp` (Mac/Linux/Windows)
|
79 |
|
80 |
+
The model is **quantized** into GGUF format and can run on Mac **without a GPU** using `llama.cpp`.
|
81 |
|
82 |
+
### **1️⃣ Install `llama.cpp`**
|
83 |
+
```sh
|
84 |
+
brew install llama.cpp
|
85 |
+
```
|
86 |
|
87 |
+
### **2️⃣ Download the Model**
|
88 |
+
```sh
|
89 |
+
mkdir -p ~/llama_models && cd ~/llama_models
|
90 |
+
wget https://huggingface.co/your-repo-id/resolve/main/q8_0.gguf
|
91 |
+
```
|
92 |
|
93 |
+
### **3️⃣ Run the Model**
|
94 |
+
```sh
|
95 |
+
llama-cli -m ~/llama_models/q8_0.gguf --interactive
|
96 |
+
```
|
97 |
|
98 |
+
### **4️⃣ Test with a Prompt**
|
99 |
+
```sh
|
100 |
+
llama-cli -m ~/llama_models/q8_0.gguf -p "Explain quantum computing in simple terms."
|
101 |
+
```
|
102 |
|
103 |
+
---
|
104 |
|
105 |
+
## 🏋️ **Training Details**
|
106 |
|
107 |
+
### **📊 Dataset Used**
|
108 |
+
The model was fine-tuned on:
|
109 |
+
🔹 [`eagle0504/openai-gsm8k-enhanced-using-together-ai-deepseek-train8k-test1k-v1`](https://huggingface.co/datasets/eagle0504/openai-gsm8k-enhanced-using-together-ai-deepseek-train8k-test1k-v1)
|
110 |
|
111 |
+
This dataset contains:
|
112 |
+
- **8K training samples**
|
113 |
+
- **1K testing samples**
|
114 |
+
- Features: `"question"`, `"answer"`, `"cot"` (Chain-of-Thought)
|
115 |
|
116 |
+
### **⚙️ Training Configuration**
|
117 |
+
- **Framework:** `transformers` + `unsloth` + `trl`
|
118 |
+
- **Optimization:**
|
119 |
+
- **LoRA (Low-Rank Adaptation)** applied to QKV projections
|
120 |
+
- **Learning Rate:** `1e-6`
|
121 |
+
- **AdamW Optimizer (8-bit)**
|
122 |
+
- **Mixed Precision (`bf16` or `fp16`)**
|
123 |
+
- **Batch Size:** `8`
|
124 |
+
- **Gradient Accumulation Steps:** `1`
|
125 |
+
- **Max Sequence Length:** `1024`
|
126 |
|
127 |
+
---
|
128 |
|
129 |
+
## 📊 **Model Performance**
|
130 |
|
131 |
+
### **✅ Training Loss**
|
132 |
+
| Step | Training Loss | Reward | KL |
|
133 |
+
|------|--------------|--------|------|
|
134 |
+
| 1 | 0.0000 | 0.0000 | 0.0000 |
|
135 |
+
| 500 | 0.0033 | 0.2617 | 0.0821 |
|
136 |
+
| 1000 | 0.0028 | 0.1359 | 0.0696 |
|
137 |
+
| 1500 | 0.0062 | 1.3781 | 0.1559 |
|
138 |
|
139 |
+
### **🧪 Testing & Expected Results**
|
140 |
+
The model was evaluated on the **1K test samples** and showed strong accuracy in multi-step problem-solving.
|
141 |
|
142 |
+
Example expected response:
|
143 |
+
```text
|
144 |
+
To solve the problem, we first find the clips sold in May:
|
145 |
+
Clips in May = 48 / 2 = 24
|
146 |
+
Next, we find the total:
|
147 |
+
Total Clips = 48 + 24 = 72
|
148 |
+
#### Answer: 72
|
149 |
+
```
|
150 |
|
151 |
+
---
|
152 |
|
153 |
+
## 🚨 **Bias, Risks, and Limitations**
|
154 |
+
### ⚠️ **Potential Risks**
|
155 |
+
- May **hallucinate** incorrect reasoning steps if prompts are unclear.
|
156 |
+
- Could struggle with **complex mathematical problems** outside its training data.
|
157 |
+
- **Limited generalization** to non-math reasoning tasks.
|
158 |
|
159 |
+
### 🎯 **Recommendations**
|
160 |
+
- If using this model for **critical applications**, verify outputs with human review.
|
161 |
+
- For **better performance**, fine-tune on **larger datasets** with real-world numerical reasoning.
|
162 |
|
163 |
+
---
|
164 |
|
165 |
+
## 🌍 **Environmental Impact**
|
166 |
+
**Estimated Carbon Emissions:**
|
167 |
+
- **Hardware Used:** NVIDIA A100 GPU
|
168 |
+
- **Training Time:** ~5 hours
|
169 |
+
- **Estimated CO2 Emitted:** ~8.2 kg CO2eq (via [ML Impact Calculator](https://mlco2.github.io/impact#compute))
|
170 |
|
171 |
+
---
|
172 |
|
173 |
+
## 📖 **Citation**
|
174 |
+
If you use this model in your research, please cite it as:
|
175 |
|
176 |
+
```bibtex
|
177 |
+
@misc{your_model_2024,
|
178 |
+
title={Fine-Tuned Qwen2.5-1.5B-Instruct on GSM8K with DeepSeek Augmentation},
|
179 |
+
author={Your Name},
|
180 |
+
year={2024},
|
181 |
+
url={https://huggingface.co/your-repo-id}
|
182 |
+
}
|
183 |
+
```
|
184 |
|
185 |
+
---
|
186 |
|
187 |
+
## 📩 **Model Card Contact**
|
188 |
+
For questions, suggestions, or issues, reach out via [Hugging Face Discussions](https://huggingface.co/your-repo-id/discussions).
|
189 |
|
190 |
+
---
|
191 |
|
192 |
+
🎉 **Thank you for using this model!** If you find it useful, please ⭐ it on **Hugging Face**! 🚀🔥
|