Redhanuman commited on
Commit
43005bd
Β·
verified Β·
1 Parent(s): 38f5511

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +183 -3
README.md CHANGED
@@ -1,3 +1,183 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - Qwen/Qwen3-0.6B
5
+ library_name: transformers
6
+ tags:
7
+ - unsloth
8
+ - reasoning
9
+ - code
10
+ - chain-of-thought
11
+ - text-generation
12
+ - shadow
13
+ - conversational
14
+ datasets:
15
+ - unsloth/gsm8k
16
+ - deepseek-ai/DeepSeek-R1
17
+ pipeline_tag: text-generation
18
+ ---
19
+
20
+ # πŸŒ‘ Shadow 0.7B (Reasoning Edition)
21
+
22
+ **Shadow 0.7B** is a specialized Small Language Model (SLM) optimized for **logical reasoning, competitive coding, and chain-of-thought processing**.
23
+
24
+ Built on the Qwen architecture and fine-tuned using **Unsloth**, Shadow punches far above its weight class, delivering "thinking" capabilities usually found in much larger models.
25
+
26
+ ## πŸš€ Key Features
27
+ * **🧠 Native Reasoning:** Trained to use `<think>` tags to plan and verify logic before answering.
28
+ * **πŸ’» Code Expert:** Optimized for Python and C++ algorithmic solutions (Chain of Draft).
29
+ * **⚑ Lightweight:** Runs comfortably on free T4 GPUs, CPUs, and mobile devices (via Ollama).
30
+ * **πŸ†” Custom Persona:** Maintains the identity of "Shadow", created by **Aman Kumar Pandey**.
31
+
32
+ ## πŸ’» Quick Start (Python)
33
+
34
+ ```python
35
+ from transformers import AutoModelForCausalLM, AutoTokenizer
36
+
37
+ model_name = "Redhanuman/Shadow-0.7B-Qwen3-Reasoning" # Replace with your actual username/repo
38
+
39
+ model = AutoModelForCausalLM.from_pretrained(
40
+ model_name,
41
+ torch_dtype="auto",
42
+ device_map="auto"
43
+ )
44
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
45
+
46
+ # Shadow works best when you ask it to think
47
+ prompt = "Write a Python script to check for palindromes. Explain your logic."
48
+ messages = [
49
+ {"role": "user", "content": prompt}
50
+ ]
51
+
52
+ text = tokenizer.apply_chat_template(
53
+ messages,
54
+ tokenize=False,
55
+ add_generation_prompt=True
56
+ )
57
+
58
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
59
+
60
+ generated_ids = model.generate(
61
+ **model_inputs,
62
+ max_new_tokens=1024
63
+ )
64
+
65
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
66
+ print(response)
67
+ πŸ¦™ Run Locally (Ollama)
68
+ If you have converted this model to GGUF, you can run it locally:
69
+
70
+ Bash
71
+
72
+ ollama run shadow
73
+ πŸ› οΈ Training Details
74
+ Creator: Aman Kumar Pandey (LPU)
75
+
76
+ Framework: Unsloth (2x Faster Training)
77
+
78
+ Base Model: Qwen 2.5 0.5B Instruct
79
+
80
+ Method: QLoRA Fine-tuning with Chain of Draft (CoD) data.
81
+
82
+ Created with ❀️ by Aman Kumar Pandey.
83
+
84
+
85
+ ### πŸ“ Instructions:
86
+ 1. Go to your Model Page on Hugging Face.
87
+ 2. Click **"Update model card"** (or create `README.md`).
88
+ 3. **Delete everything** currently there.
89
+ 4. **Paste** the code above.
90
+ 5. **Important:** In the Python code section, make sure `Redhanuman/Shadow-0.7B-Qwen3-Reasoning` matches your *exact* repo name.
91
+ 6. Click **Commit changes**.
92
+
93
+
94
+ ---
95
+ license: apache-2.0
96
+ base_model: Qwen/Qwen2.5-0.5B-Instruct
97
+ library_name: transformers
98
+ tags:
99
+ - unsloth
100
+ - reasoning
101
+ - code
102
+ - chain-of-thought
103
+ - text-generation
104
+ - shadow
105
+ - conversational
106
+ datasets:
107
+ - unsloth/gsm8k
108
+ - deepseek-ai/DeepSeek-R1
109
+ pipeline_tag: text-generation
110
+ ---
111
+
112
+ # πŸŒ‘ Shadow 0.7B (Reasoning Edition)
113
+
114
+ **Shadow 0.7B** is a specialized Small Language Model (SLM) optimized for **logical reasoning, competitive coding, and chain-of-thought processing**.
115
+
116
+ Built on the Qwen architecture and fine-tuned using **Unsloth**, Shadow punches far above its weight class, delivering "thinking" capabilities usually found in much larger models.
117
+
118
+ ## πŸš€ Key Features
119
+ * **🧠 Native Reasoning:** Trained to use `<think>` tags to plan and verify logic before answering.
120
+ * **πŸ’» Code Expert:** Optimized for Python and C++ algorithmic solutions (Chain of Draft).
121
+ * **⚑ Lightweight:** Runs comfortably on free T4 GPUs, CPUs, and mobile devices (via Ollama).
122
+ * **πŸ†” Custom Persona:** Maintains the identity of "Shadow", created by **Aman Kumar Pandey**.
123
+
124
+ ## πŸ’» Quick Start (Python)
125
+
126
+ ```python
127
+ from transformers import AutoModelForCausalLM, AutoTokenizer
128
+
129
+ model_name = "Redhanuman/Shadow-0.7B-Qwen3-Reasoning" # Replace with your actual username/repo
130
+
131
+ model = AutoModelForCausalLM.from_pretrained(
132
+ model_name,
133
+ torch_dtype="auto",
134
+ device_map="auto"
135
+ )
136
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
137
+
138
+ # Shadow works best when you ask it to think
139
+ prompt = "Write a Python script to check for palindromes. Explain your logic."
140
+ messages = [
141
+ {"role": "user", "content": prompt}
142
+ ]
143
+
144
+ text = tokenizer.apply_chat_template(
145
+ messages,
146
+ tokenize=False,
147
+ add_generation_prompt=True
148
+ )
149
+
150
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
151
+
152
+ generated_ids = model.generate(
153
+ **model_inputs,
154
+ max_new_tokens=1024
155
+ )
156
+
157
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
158
+ print(response)
159
+ πŸ¦™ Run Locally (Ollama)
160
+ If you have converted this model to GGUF, you can run it locally:
161
+
162
+ Bash
163
+
164
+ ollama run shadow
165
+ πŸ› οΈ Training Details
166
+ Creator: Aman Kumar Pandey (LPU)
167
+
168
+ Framework: Unsloth (2x Faster Training)
169
+
170
+ Base Model: Qwen 2.5 0.5B Instruct
171
+
172
+ Method: QLoRA Fine-tuning with Chain of Draft (CoD) data.
173
+
174
+ Created with ❀️ by Aman Kumar Pandey.
175
+
176
+
177
+ ### πŸ“ Instructions:
178
+ 1. Go to your Model Page on Hugging Face.
179
+ 2. Click **"Update model card"** (or create `README.md`).
180
+ 3. **Delete everything** currently there.
181
+ 4. **Paste** the code above.
182
+ 5. **Important:** In the Python code section, make sure `Redhanuman/Shadow-0.7B-Qwen3-Reasoning` matches your *exact* repo name.
183
+ 6. Click **Commit changes**.