File size: 4,939 Bytes
b8079d7
 
200d943
 
 
 
 
 
 
 
 
 
 
 
 
 
b0e7665
 
 
 
b8079d7
200d943
b0e7665
200d943
 
b0e7665
200d943
 
 
 
b0e7665
200d943
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8bbb0ca
200d943
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b0e7665
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
---
license: apache-2.0
viewer: false
datasets:
- HuggingFaceFW/fineweb-edu
language:
- en
pipeline_tag: text-generation
library_name: transformers
tags:
- small
- tiny
- supra
- supra2
- qwen3
- efficient
- instruct
- chat
base_model:
- SupraLabs/Supra2-Medium-Base
---

<h1 align="center">Supra2-Medium Instruct</h1>

<p align="center">
  Ultra-efficient chat instruction model • 25M Parameters • 1K Context
</p>

![supra2-medium](https://cdn-uploads.huggingface.co/production/uploads/697f2832c2c5e4daa93cece7/-YjDJGlcGyTN5yClAaEv3.png)

**Supra2-Medium Instruct** is a 25M-parameter decoder-only language model pretrained from scratch by **SupraLabs** on 20B tokens of English web text. It uses the **Qwen3** architecture with a custom 16,384-token tokenizer. This is the instruct version of Supra2-Medium-Base.

---

## **Some samples...**

Prompt: "How does ChatGPT work?"
Answer:
```plaintext
ChatGT is a chatbot-based AI that uses text-based language to generate and share information, such as responses, responses, and other forms of communication. It works by using natural language processing (NLP) to generate text, which is then converted into actionable responses. The AI then uses this NLP to generate the text, making it available for downloading, sharing, and retrieving.

The AI then generates the text based on the input, allowing users to respond quickly and efficiently. This process is called "collaboration" or "memory" of the input text, where users can share their thoughts, feelings, and experiences with others. The chatbot then uses the text to generate responses, which are then sent to the AI to be used by the user.
Overall, Chat GPT is a powerful tool for creating and sharing content, and it has become an integral part of many modern daily life, enabling people to interact with and understand the world around them.
```

Prompt: "What is AI?"
Answer:
```plaintext
AI is a technology that enables machines to learn, adapt, and improve their behavior. It's a way for humans to learn and adapt to new situations, from simple tasks like reading to more complex ones like writing. AI is used in various fields, including education, healthcare, and social sciences, as well as in the field of psychology, where it helps people understand and respond to emotions, behaviors, and experiences.

In essence, AI is designed to help individuals learn, adjust, and thrive in a world where they can learn and grow, while also being able to adapt and learn from their environment. This means that AI can be used to make decisions, solve problems, and even learn from others, making it a valuable tool for individuals who want to learn more about themselves and their surroundings.
```

Prompt: "What is 2+2 ?"
Answer:
```plaintext
The result is **4**.
```

---

## **Finetuning Data**

| Source | Approx. share |
| ----- | ----- |
| `smol-smoltalk` | 77.5% |
| Synthethic Basic Arithmetic | 9.3% |
| `qwedsacf/grade-school-math-instructions` | 4.5% |
| no_robots | 3.4% |
| Style Rewrite of `smol-smoltalk` | 2.5% |
| Style Rewrite of `no_robots` | 1.5% |
| Templated `b-mc2/wikihow_lists` | 1.2% |

---

## **Usage**

```python  
import torch
from tokenizers import pre_tokenizers
from transformers import AutoModelForCausalLM, AutoTokenizer

REPO_ID = "SupraLabs/Supra2-Medium-Instruct"
device = "cuda" if torch.cuda.is_available() else "cpu"

print(f"[*] Loading model and tokenizer from Hub: {REPO_ID}...")

# 1. Load Tokenizer & configure ByteLevel pre-tokenizer
tokenizer = AutoTokenizer.from_pretrained(REPO_ID, trust_remote_code=True)
tokenizer._tokenizer.pre_tokenizer = pre_tokenizers.ByteLevel(add_prefix_space=False)

# 2. Load Model
model = AutoModelForCausalLM.from_pretrained(
    REPO_ID,
    torch_dtype=torch.bfloat16 if torch.cuda.is_available() else torch.float32,
    device_map="auto" if torch.cuda.is_available() else None,
    trust_remote_code=True
)
model.eval()

# 3. Prepare Chat Prompt
messages = [
    {"role": "user", "content": "What is AI?"}
]

prompt_text = tokenizer.apply_chat_template(
    messages, 
    tokenize=False, 
    add_generation_prompt=True
)

inputs = tokenizer(prompt_text, return_tensors="pt").to(device)

print("[*] Generating response...\n")

# 4. Generate
im_end_id = tokenizer.convert_tokens_to_ids("<|im_end|>")
eos_ids = [im_end_id, tokenizer.eos_token_id] if im_end_id is not None else tokenizer.eos_token_id

with torch.no_grad():
    output_ids = model.generate(
        **inputs,
        max_new_tokens=256,
        do_sample=True,
        temperature=0.2,
        top_p=0.85,
        top_k=25,
        no_repeat_ngram_size=3,
        pad_token_id=tokenizer.pad_token_id,
        eos_token_id=eos_ids
    )

# 5. Extract & Decode Response
generated_tokens = output_ids[0][inputs["input_ids"].shape[-1]:]
response = tokenizer.decode(generated_tokens, skip_special_tokens=True)

print("--- Output ---")
print(response.strip())
```

---

*© SupraLabs 2026*