Update README.md
Browse files
README.md
CHANGED
@@ -5,4 +5,103 @@ datasets:
|
|
5 |
base_model:
|
6 |
- HuggingFaceTB/SmolLM2-360M-Instruct
|
7 |
library_name: transformers
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
base_model:
|
6 |
- HuggingFaceTB/SmolLM2-360M-Instruct
|
7 |
library_name: transformers
|
8 |
+
language:
|
9 |
+
- en
|
10 |
+
pipeline_tag: text-generation
|
11 |
+
tags:
|
12 |
+
- trl
|
13 |
+
- text-generation-inference
|
14 |
+
- re-think
|
15 |
+
- r1
|
16 |
+
---
|
17 |
+
|
18 |
+

|
19 |
+
|
20 |
+
# **SmolLM2-Rethink-360M**
|
21 |
+
|
22 |
+
> **SmolLM2-Rethink-360M** is an experimental lightweight reasoning model trained on the **Celestia3-DeepSeek-R1-0528** dataset. Built on top of the **SmolLM2-135M-Instruct** architecture and scaled to 360M parameters, it is designed to enhance lightweight reasoning, logical deduction, and structured response generation—all while maintaining efficiency for resource-constrained environments.
|
23 |
+
|
24 |
+
---
|
25 |
+
|
26 |
+
## **Key Highlights**
|
27 |
+
|
28 |
+
1. **Compact Yet Powerful**
|
29 |
+
With 360M parameters, the model balances performance and efficiency, offering solid reasoning capabilities with fast inference speeds.
|
30 |
+
|
31 |
+
2. **Reasoning-Oriented Training**
|
32 |
+
Fine-tuned on instruction-tuned datasets like **Celestia3-DeepSeek-R1-0528**, optimized for logical step-by-step thinking.
|
33 |
+
|
34 |
+
3. **Optimized for Edge & Research**
|
35 |
+
Usable on mid-range GPUs or CPU environments, making it ideal for experimentation, teaching, and lightweight deployment.
|
36 |
+
|
37 |
+
4. **Structured Generation Support**
|
38 |
+
Capable of outputting well-organized content such as JSON, lists, workflows, and tabular formats.
|
39 |
+
|
40 |
+
---
|
41 |
+
|
42 |
+
## **Quickstart with 🤗 Transformers**
|
43 |
+
|
44 |
+
```python
|
45 |
+
%%capture
|
46 |
+
!pip install transformers
|
47 |
+
```
|
48 |
+
|
49 |
+
```py
|
50 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
51 |
+
|
52 |
+
checkpoint = "prithivMLmods/SmolLM2-Rethink-360M"
|
53 |
+
device = "cuda" # or "cpu"
|
54 |
+
|
55 |
+
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
56 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
|
57 |
+
|
58 |
+
messages = [{"role": "user", "content": "What is gravity?"}]
|
59 |
+
input_text = tokenizer.apply_chat_template(messages, tokenize=False)
|
60 |
+
print(input_text)
|
61 |
+
|
62 |
+
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
|
63 |
+
outputs = model.generate(
|
64 |
+
inputs,
|
65 |
+
max_new_tokens=1024,
|
66 |
+
temperature=0.2,
|
67 |
+
top_p=0.9,
|
68 |
+
do_sample=True
|
69 |
+
)
|
70 |
+
|
71 |
+
print(tokenizer.decode(outputs[0]))
|
72 |
+
```
|
73 |
+
|
74 |
+
---
|
75 |
+
|
76 |
+
## **Intended Use**
|
77 |
+
|
78 |
+
* **Lightweight Reasoning Tasks**
|
79 |
+
Suitable for compact agents needing reasoning abilities without high compute requirements.
|
80 |
+
|
81 |
+
* **Educational & Research Assistants**
|
82 |
+
Ideal for logic tutors, student aides, or research prototypes.
|
83 |
+
|
84 |
+
* **Instruction Following & Structured QA**
|
85 |
+
Excels in scenarios requiring concise, step-by-step or well-formatted responses.
|
86 |
+
|
87 |
+
* **Microservices & Embedded AI**
|
88 |
+
Can be embedded in systems with modest hardware, enabling distributed or modular AI.
|
89 |
+
|
90 |
+
---
|
91 |
+
|
92 |
+
## **Limitations**
|
93 |
+
|
94 |
+
1. **Knowledge Scope**
|
95 |
+
Smaller models naturally have less factual coverage compared to large-scale LLMs.
|
96 |
+
|
97 |
+
2. **Context Length**
|
98 |
+
Best used with shorter prompts and outputs due to token and memory constraints.
|
99 |
+
|
100 |
+
3. **Variability in Creative Tasks**
|
101 |
+
Less suited for imaginative writing or nuanced creative expression.
|
102 |
+
|
103 |
+
4. **Limited Real-World Awareness**
|
104 |
+
Model does not have real-time or post-training data awareness.
|
105 |
+
|
106 |
+
5. **Prompt Sensitivity**
|
107 |
+
Outputs can vary based on phrasing; best results come from clear, guided prompts.
|