File size: 4,035 Bytes
932dd4c
 
 
 
 
 
 
da3498a
 
 
 
 
 
 
b3e8008
da3498a
932dd4c
 
b3e8008
932dd4c
b3e8008
 
 
 
932dd4c
b3e8008
 
 
 
 
 
 
 
 
 
 
 
 
 
932dd4c
da3498a
932dd4c
b3e8008
932dd4c
da3498a
b3e8008
 
 
 
932dd4c
b3e8008
932dd4c
da3498a
932dd4c
b3e8008
932dd4c
b3e8008
 
 
 
 
932dd4c
b3e8008
932dd4c
b3e8008
932dd4c
b3e8008
932dd4c
b3e8008
 
 
 
932dd4c
b3e8008
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
932dd4c
da3498a
932dd4c
b3e8008
932dd4c
da3498a
 
 
 
932dd4c
b3e8008
da3498a
 
 
 
 
 
b3e8008
 
da3498a
b3e8008
 
da3498a
b3e8008
da3498a
 
932dd4c
da3498a
932dd4c
b3e8008
932dd4c
b3e8008
 
 
932dd4c
da3498a
932dd4c
b3e8008
 
 
932dd4c
da3498a
932dd4c
b3e8008
932dd4c
b3e8008
 
 
932dd4c
b3e8008
932dd4c
b3e8008
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
---
base_model: Qwen/Qwen3-VL-8B-Instruct
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:Qwen/Qwen3-VL-8B-Instruct
- lora
- peft
- vision-language
- qwen3-vl
- coding
- math
- darija
- fine-tuned
- beginner-friendly
license: apache-2.0
---

# ๐Ÿง  Mtrini-SVL-1.0 (Adapter)

> **Mtrini** (ู…ุชุฑุจู‘ูŠ) comes from **Darija** โ€” Moroccan Arabic โ€” and means
> **"trained"** or **"well-fit."** ๐Ÿ’ช That's exactly what this model is: a
> smart base model that we trained a little further to be great at **coding**
> and **math** โ€” while still being able to **see images.** ๐Ÿ‘€

---

## ๐Ÿค” What is this, in plain English?

There are two pieces here:

1. **A big, powerful base model** ๐Ÿ—๏ธ โ€” `Qwen3-VL-8B-Instruct`. It already knows
   a lot and can understand both text and images.

2. **A small "adapter"** ๐Ÿงฉ โ€” this is the *Mtrini* part. Instead of retraining
   the whole giant model (expensive! ๐Ÿ’ธ), we trained a lightweight add-on that
   nudges the base model to be better at coding and math.

**This repo is the adapter** ๐Ÿงฉ โ€” the little piece that plugs into the big model.

---

## ๐Ÿ“– What's in the name?

**Mtrini** (ู…ุชุฑุจู‘ูŠ) in Darija means *trained* or *well-fit* โ€” the root
*m-r-b* carries the sense of being raised, cultivated, and prepared. ๐ŸŒฑ

That's literally what happened here: a capable foundation model, further
trained on focused data to become *well-fit* for reasoning tasks.

๐Ÿ—ฃ๏ธ *Say it like: "em-tree-nee."*

---

## โœจ What can it do?

| Skill | Description |
|-------|-------------|
| ๐Ÿ’ป **Coding** | Write functions, fix bugs, explain how code works |
| ๐Ÿงฎ **Math** | Solve problems step by step and show its reasoning |
| ๐Ÿ‘€ **Vision** | Describe images, read screenshots, and answer questions about pictures |

---

## ๐Ÿ“š What was it trained on?

Two public datasets, chosen to make it sharp at reasoning:

| ๐Ÿ“ฆ Dataset | ๐ŸŽฏ Focus |
|-----------|----------|
| `Bespoke-Stratos-17k` | Coding & problem-solving |
| `OpenR1-Math-220k` | Mathematical reasoning |

---

## ๐Ÿ”ง Technical details (for the curious)

| Setting | Value |
|---------|-------|
| ๐Ÿ—๏ธ Base model | `Qwen/Qwen3-VL-8B-Instruct` (8.81B params) |
| ๐Ÿงฉ Adapter type | LoRA (rank 16) |
| ๐ŸŽฏ Target modules | Attention + MLP projections |
| ๐Ÿ“ Context length | 2048 |
| ๐Ÿš€ Learning rate | 2e-4 |
| ๐Ÿ”ข Max steps | 1000 |

> **LoRA** stands for *Low-Rank Adaptation* โ€” a clever way to fine-tune a big
> model by training only a tiny fraction of its weights. That's why the adapter
> is small and fast to share. ๐Ÿชถ

---

## ๐Ÿš€ How to use it

```python
import torch
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
from peft import PeftModel

# 1๏ธโƒฃ Load the big base model
base = Qwen3VLForConditionalGeneration.from_pretrained(
    "Qwen/Qwen3-VL-8B-Instruct",
    dtype=torch.bfloat16,
    device_map="auto",
    attn_implementation="sdpa",
)

# 2๏ธโƒฃ Plug in the Mtrini adapter
model = PeftModel.from_pretrained(base, "CompiwerAI/Mtrini-SVL-1.0")

# 3๏ธโƒฃ Load the processor (handles text + images)
processor = AutoProcessor.from_pretrained("CompiwerAI/Mtrini-SVL-1.0")

model.eval()
```

---

## ๐Ÿ“ฆ Want to skip the setup? Use the GGUF!

If all that Python looks intimidating, we've got you covered. ๐Ÿ™‚ We **merged**
the adapter into the base model and **quantized** it into a single file you can
run locally with no Python at all:

๐Ÿ‘‰ **[CompiwerAI/Mtrini-SVL-1.0-GGUF](https://huggingface.co/CompiwerAI/Mtrini-SVL-1.0-GGUF)**

- ๐Ÿ—œ๏ธ One file, ~8.7 GB
- ๐Ÿ–ฅ๏ธ Runs with [llama.cpp](https://github.com/ggml-org/llama.cpp)
- ๐Ÿ–ผ๏ธ Vision included โ€” no extra files needed

---

## โš ๏ธ Things to keep in mind

- It's trained for a relatively short schedule (1000 steps) on a focused mix.
- It inherits both the strengths and the limitations of the base model.
- ๐Ÿงช Always test on **your** use case before relying on it in production.

## ๐Ÿ“œ License

Apache 2.0 โ€” same as the base model. โœ