Redhanuman commited on
Commit
cabbd05
ยท
verified ยท
1 Parent(s): 43005bd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -129
README.md CHANGED
@@ -1,99 +1,7 @@
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
@@ -111,22 +19,28 @@ pipeline_tag: text-generation
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,
@@ -135,7 +49,6 @@ model = AutoModelForCausalLM.from_pretrained(
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}
@@ -147,37 +60,19 @@ text = tokenizer.apply_chat_template(
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**.
 
1
  ---
2
  license: apache-2.0
3
  base_model:
4
+ - Qwen/Qwen3-0.6B
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  library_name: transformers
6
  tags:
7
  - unsloth
 
19
 
20
  # ๐ŸŒ‘ Shadow 0.7B (Reasoning Edition)
21
 
22
+ **Shadow 0.7B** is a specialized Small Language Model (SLM) optimized for **logical reasoning, competitive programming, and chain-of-thought processing**.
23
 
24
+ Built on the **Qwen3 0.6B** architecture and fine-tuned using **Unsloth**, Shadow delivers surprising reasoning depth and "thinking-first" responses uncommon for a model of this size.
25
+
26
+ ---
27
 
28
  ## ๐Ÿš€ Key Features
29
+
30
+ * ๐Ÿง  **Structured Reasoning:** Uses `<think>` style internal reasoning patterns to improve answer quality.
31
+ * ๐Ÿ’ป **Coding Specialist:** Excels at Python, C++, and algorithmic problem-solving.
32
+ * โšก **Ultra-Lightweight:** Runs on CPU, T4, mobile, or even low-VRAM consumer GPUs.
33
+ * ๐Ÿ†” **Custom Identity:** Retains the persona of **Shadow**, created by **Aman Kumar Pandey**.
34
+
35
+ ---
36
 
37
  ## ๐Ÿ’ป Quick Start (Python)
38
 
39
  ```python
40
  from transformers import AutoModelForCausalLM, AutoTokenizer
41
+ import torch
42
 
43
+ model_name = "Redhanuman/Shadow-0.7B-Qwen3-Reasoning" # Replace with your repo
44
 
45
  model = AutoModelForCausalLM.from_pretrained(
46
  model_name,
 
49
  )
50
  tokenizer = AutoTokenizer.from_pretrained(model_name)
51
 
 
52
  prompt = "Write a Python script to check for palindromes. Explain your logic."
53
  messages = [
54
  {"role": "user", "content": prompt}
 
60
  add_generation_prompt=True
61
  )
62
 
63
+ inputs = tokenizer([text], return_tensors="pt").to(model.device)
64
 
65
  generated_ids = model.generate(
66
+ **inputs,
67
  max_new_tokens=1024
68
  )
69
 
70
+ print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))
71
+ ```
72
+ ## ๐Ÿ› ๏ธ Training Details
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
+ - **Creator:** Aman Kumar Pandey (LPU)
75
+ - **Framework:** Unsloth (2ร— faster training)
76
+ - **Base Model:** Qwen3-0.6B
77
+ - **Method:** QLoRA fine-tuning with Chain-of-Draft (CoD) reasoning data
78
+ - **Datasets:** GSM8K, DeepSeek R1 distilled reasoning samples