Update README.md
Browse files
README.md
CHANGED
@@ -8,14 +8,84 @@ tags:
|
|
8 |
license: apache-2.0
|
9 |
language:
|
10 |
- en
|
|
|
|
|
11 |
---
|
12 |
|
13 |
-
#
|
14 |
|
15 |
-
|
16 |
-
- **License:** apache-2.0
|
17 |
-
- **Finetuned from model :** unsloth/gpt-oss-20b-unsloth-bnb-4bit
|
18 |
|
19 |
-
This
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
license: apache-2.0
|
9 |
language:
|
10 |
- en
|
11 |
+
datasets:
|
12 |
+
- microsoft/rStar-Coder
|
13 |
---
|
14 |
|
15 |
+
# GPT-OSS-Coder-20B
|
16 |
|
17 |
+
<img src="banner.png" width="800" />
|
|
|
|
|
18 |
|
19 |
+
This model is a fine-tuned version of OpenAI's **GPT-OSS-20B**, optimized for code generation tasks. The fine-tuning leveraged the **Unsloth** library to enable efficient low-bit quantized training and inference.
|
20 |
|
21 |
+
## Model Details
|
22 |
+
|
23 |
+
* **Base Model:** [openai/gpt-oss-20b](https://huggingface.co/openai/gpt-oss-20b)
|
24 |
+
* **Training Framework:** Hugging Face's TRL library combined with [Unsloth](https://github.com/Unsloth-org/Unsloth) optimizations.
|
25 |
+
* **Training Data:** 1 million randomly generated records, trained for 150 steps
|
26 |
+
|
27 |
+
## Intended Use
|
28 |
+
|
29 |
+
This model is designed to assist with:
|
30 |
+
|
31 |
+
* Code generation and completion
|
32 |
+
* Programming query answering
|
33 |
+
* Code summarization
|
34 |
+
|
35 |
+
## About `reasoning_effort`
|
36 |
+
|
37 |
+
The `reasoning_effort` parameter influences the model's focus during text generation:
|
38 |
+
|
39 |
+
* **`low`**: Produces straightforward, concise answers suitable for simple coding tasks.
|
40 |
+
* **`medium`**: Balances speed and detail, suitable for moderate complexity tasks.
|
41 |
+
* **`high`**: Encourages detailed and complex reasoning, useful for advanced code generation or explanations.
|
42 |
+
|
43 |
+
Adjusting this parameter allows you to control the depth of the model's reasoning process, balancing between performance and response complexity.
|
44 |
+
|
45 |
+
## Usage Example
|
46 |
+
|
47 |
+
```python
|
48 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
49 |
+
from transformers import TextStreamer
|
50 |
+
|
51 |
+
tokenizer = AutoTokenizer.from_pretrained("yasserrmd/gpt-oss-coder-20b")
|
52 |
+
model = AutoModelForCausalLM.from_pretrained("yasserrmd/gpt-oss-coder-20b")
|
53 |
+
|
54 |
+
messages = [
|
55 |
+
{"role": "system", "content": "You are a helpful coding assistant."},
|
56 |
+
{"role": "user", "content": "Using Python to connect MySQL and retrieve table 'employee' where empno is 1234."},
|
57 |
+
]
|
58 |
+
|
59 |
+
inputs = tokenizer.apply_chat_template(
|
60 |
+
messages,
|
61 |
+
add_generation_prompt=True,
|
62 |
+
return_tensors="pt",
|
63 |
+
return_dict=True,
|
64 |
+
reasoning_effort="low",
|
65 |
+
).to(model.device)
|
66 |
+
|
67 |
+
streamer = TextStreamer(tokenizer)
|
68 |
+
_ = model.generate(**inputs, max_new_tokens=512, streamer=streamer)
|
69 |
+
```
|
70 |
+
|
71 |
+
## Training Overview
|
72 |
+
|
73 |
+
The fine-tuning process adapted GPT-OSS-20B to better assist with coding tasks by fine-tuning on a dataset of 1 million random records. The training utilized **only the Unsloth** library for efficient low-bit quantized fine-tuning.
|
74 |
+
|
75 |
+
## Citation
|
76 |
+
|
77 |
+
```bibtex
|
78 |
+
@misc{yasserrmd2025gptosscoder20b,
|
79 |
+
author = {Yasser RMD},
|
80 |
+
title = {GPT-OSS-Coder-20B},
|
81 |
+
year = {2025},
|
82 |
+
publisher = {Hugging Face},
|
83 |
+
journal = {Hugging Face Model Hub},
|
84 |
+
url = {https://huggingface.co/yasserrmd/gpt-oss-coder-20b}
|
85 |
+
}
|
86 |
+
```
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
+
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|