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| 1 |
+
---
|
| 2 |
+
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
|
| 5 |
+
base_model: unsloth/gpt-oss-20b-unsloth-bnb-4bit
|
| 6 |
+
|
| 7 |
+
tags:
|
| 8 |
+
|
| 9 |
+
- code
|
| 10 |
+
|
| 11 |
+
- reasoning
|
| 12 |
+
|
| 13 |
+
- fine-tuned
|
| 14 |
+
|
| 15 |
+
- unsloth
|
| 16 |
+
|
| 17 |
+
- gguf
|
| 18 |
+
|
| 19 |
+
- coding-assistant
|
| 20 |
+
|
| 21 |
+
library_name: transformers
|
| 22 |
+
|
| 23 |
+
model_creator: Erfan Mohamadnia
|
| 24 |
+
|
| 25 |
+
model_name: DgMind-20B
|
| 26 |
+
|
| 27 |
+
pipeline_tag: text-generation
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
# DgMind 20B: Advanced Reasoning & Expert Coding Assistant
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
**DgMind 20B** is a state-of-the-art, fine-tuned large language model designed for high-level logical reasoning and professional-grade software development. Built upon the **GPT-OSS 20B** architecture, this model has been optimized using the Unsloth library to provide efficient yet powerful performance on consumer-grade hardware.
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
## ๐ค Identity & Developer
|
| 42 |
+
|
| 43 |
+
* **Model Name:** DgMind
|
| 44 |
+
|
| 45 |
+
* **Developer:** Erfan Mohamadnia
|
| 46 |
+
|
| 47 |
+
* **Core Persona:** A specialized AI assistant that excels in complex coding tasks, architectural decisions, and deep logical analysis.
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
## ๐ Training Details
|
| 52 |
+
|
| 53 |
+
- **Base Model:** GPT-OSS 20B (Unsloth 4-bit optimized)
|
| 54 |
+
|
| 55 |
+
- **Dataset:** [Code-290k-ShareGPT](https://huggingface.co/datasets/ajibawa-2023/Code-290k-ShareGPT)
|
| 56 |
+
|
| 57 |
+
- **Technique:** LoRA (Low-Rank Adaptation)
|
| 58 |
+
|
| 59 |
+
- **Optimization:** Fine-tuned specifically on responses to enhance conversational accuracy and identity injection.
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
## ๐ Performance & Convergence
|
| 64 |
+
|
| 65 |
+
The model demonstrates a stable decrease in training loss, ensuring precise instruction following and a minimized hallucination rate in coding contexts.
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
## ๐ฌ Prompt Template (Chat Format)
|
| 74 |
+
|
| 75 |
+
DgMind uses the following message structure to maintain context and role separation:
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
```text
|
| 80 |
+
|
| 81 |
+
{% for message in messages %}{{ '<|start|>' + message['role'] + '<|message|>' + message['content'] + '<|end|>' }}{% endfor %}{% if add_generation_prompt %}{{ '<|start|>assistant<|message|>' }}{% endif %}
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
### Example:
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
```text
|
| 94 |
+
|
| 95 |
+
<|start|>user<|message|>Write a Python script for a custom API gateway.<|end|>
|
| 96 |
+
|
| 97 |
+
<|start|>assistant<|message|>
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
## ๐ Deployment & Usage
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
### Local Execution via Ollama
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
1. Download the `.gguf` file.
|
| 114 |
+
|
| 115 |
+
2. Create a file named `Modelfile`:
|
| 116 |
+
|
| 117 |
+
```dockerfile
|
| 118 |
+
|
| 119 |
+
FROM "./DgMind-20B.Q4_K_M.gguf"
|
| 120 |
+
|
| 121 |
+
PARAMETER temperature 0.7
|
| 122 |
+
|
| 123 |
+
SYSTEM """You are DgMind, a helpful AI assistant developed by Erfan Mohamadnia. You specialize in advanced reasoning and expert-level coding."""
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
3. Run: `ollama create DgMind -f Modelfile` then `ollama run DgMind`.
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
### Server Integration (llama.cpp)
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
Run the internal API server:
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
```bash
|
| 146 |
+
|
| 147 |
+
./llama-server -m DgMind-20B.Q4_K_M.gguf --host 0.0.0.0 --port 8080 --n-gpu-layers 62
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
## ๐ Acknowledgments
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
Special thanks to the **Unsloth AI** team for their memory-efficient fine-tuning kernels, and to **ajibawa-2023** for providing the high-quality ShareGPT dataset.
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
```
|