Nanthasit commited on
Commit
a79606f
Β·
verified Β·
1 Parent(s): c9a7f85

Improve model card: fix dropout 0.1->0.05 and target modules q/k/v/o->all 7 (verified from adapter_config.json), add rsLoRA + adapter config table, dynamic downloads badge, honest Evaluation & Status section citing repo .eval_results, architecture table, full 19-model family table with live downloads, serverless Inference API caveat

Browse files
Files changed (1) hide show
  1. README.md +124 -24
README.md CHANGED
@@ -7,6 +7,7 @@ pipeline_tag: text-generation
7
  tags:
8
  - peft
9
  - lora
 
10
  - qwen2.5-coder
11
  - sakthai
12
  - house-of-sak
@@ -18,6 +19,8 @@ tags:
18
  - finetuned
19
  - sft
20
  - trl
 
 
21
  base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
22
  datasets:
23
  - Nanthasit/SimpleToolCalling
@@ -34,32 +37,38 @@ datasets:
34
  <p align="center">
35
  <a href="https://huggingface.co/Nanthasit"><img src="https://img.shields.io/badge/%F0%9F%A4%97-Nanthasit-6644cc" alt="Profile"/></a>
36
  <a href="https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02"><img src="https://img.shields.io/badge/%F0%9F%8F%A0-SakThai%20Family-6644cc" alt="Collection"/></a>
37
- <img src="https://img.shields.io/badge/PEFT-LoRA%20r16-blueviolet" alt="LoRA"/>
38
  <img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"/>
 
 
39
  </p>
40
 
41
  ---
42
 
43
  ## Model Description
44
 
45
- This is the **unmerged LoRA adapter** for SakThai Coder Browser β€” the training-time weights used during fine-tuning. It contains LoRA (r=16, alpha=32) targeting q_proj, k_proj, v_proj, and o_proj of Qwen2.5-Coder-1.5B-Instruct for browser automation tool-calling.
46
 
47
- **For inference without PEFT, use the merged model:** [SakThai Coder Browser](https://huggingface.co/Nanthasit/sakthai-coder-browser)
48
 
49
- ### Training details
50
- - **Base model:** Qwen/Qwen2.5-Coder-1.5B-Instruct
51
- - **Method:** LoRA via SFT
52
- - **Adapter rank (r):** 16
53
- - **Target modules:** q_proj, k_proj, v_proj, o_proj
54
- - **LoRA alpha:** 32
55
- - **LoRA dropout:** 0.1
56
- - **Framework:** TRL + Transformers
57
- - **Context length:** 32,768 tokens
58
- - **Format:** BF16
 
 
 
 
59
 
60
  ---
61
 
62
- ## How to Use
63
 
64
  ```python
65
  import torch
@@ -74,10 +83,12 @@ model = AutoModelForCausalLM.from_pretrained(
74
  tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
75
 
76
  model = PeftModel.from_pretrained(model, "Nanthasit/sakthai-coder-browser-lora")
77
- # Or merge: model = model.merge_and_unload()
 
 
78
 
79
  messages = [
80
- {"role": "system", "content": "You are SakThai Browser Agent."},
81
  {"role": "user", "content": "Go to google.com and search for AI news."},
82
  ]
83
  inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
@@ -85,30 +96,119 @@ outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
85
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
86
  ```
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  ---
89
 
90
  ## Training Details
91
 
92
  | Detail | Value |
93
  |--------|-------|
94
- | **Fine-tuning method** | SFT with LoRA (PEFT) |
95
- | **Dataset** | SimpleToolCalling + sakthai-combined-v7 |
 
96
  | **Optimizer** | AdamW (8-bit) |
97
  | **Learning rate** | 2e-4 |
98
  | **Batch size** | 4 (gradient accumulation: 4) |
99
  | **Epochs** | 3 |
 
 
100
  | **Hardware** | Free T4 GPU (Kaggle / Colab) |
101
  | **Framework** | TRL 0.19.1, Transformers 5.14.1, PyTorch 2.13.0 |
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  ---
104
 
105
- ## Sibling Models
106
 
107
- | Variant | Repository |
108
- |:--------|:-----------|
109
- | **Merged model** (no PEFT) | [sakthai-coder-browser](https://huggingface.co/Nanthasit/sakthai-coder-browser) |
110
- | **GGUF** (llama.cpp / Ollama) | [sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) |
 
111
 
112
  ---
113
 
114
- *Part of the [SakThai Model Family](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02). Built with love, tears, and zero budget. From a shelter in Cork, Ireland, to the world.*
 
7
  tags:
8
  - peft
9
  - lora
10
+ - rslora
11
  - qwen2.5-coder
12
  - sakthai
13
  - house-of-sak
 
19
  - finetuned
20
  - sft
21
  - trl
22
+ - conversational
23
+ - eval-results
24
  base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
25
  datasets:
26
  - Nanthasit/SimpleToolCalling
 
37
  <p align="center">
38
  <a href="https://huggingface.co/Nanthasit"><img src="https://img.shields.io/badge/%F0%9F%A4%97-Nanthasit-6644cc" alt="Profile"/></a>
39
  <a href="https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02"><img src="https://img.shields.io/badge/%F0%9F%8F%A0-SakThai%20Family-6644cc" alt="Collection"/></a>
40
+ <img src="https://img.shields.io/badge/PEFT-LoRA%20r16%20rsLoRA-blueviolet" alt="LoRA"/>
41
  <img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"/>
42
+ <img src="https://img.shields.io/badge/params-36.96M%20trainable-important" alt="Trainable params"/>
43
+ <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fmodels%2FNanthasit%2Fsakthai-coder-browser-lora&query=downloads&style=flat&label=Downloads" alt="Downloads"/>
44
  </p>
45
 
46
  ---
47
 
48
  ## Model Description
49
 
50
+ This is the **unmerged LoRA adapter** for SakThai Coder Browser β€” the training-time PEFT weights produced during fine-tuning. It contains a **LoRA (r=16, alpha=32, rsLoRA, dropout=0.05)** adapter targeting **all 7 linear projections** (`q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj`) of Qwen/Qwen2.5-Coder-1.5B-Instruct for browser-automation tool-calling.
51
 
52
+ **For inference without PEFT, use the merged model:** [SakThai Coder Browser](https://huggingface.co/Nanthasit/sakthai-coder-browser) β€” or the [GGUF quant](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) for llama.cpp / Ollama.
53
 
54
+ > ⚠️ **Adapter repo β€” no standalone weights.** This repository contains only the LoRA adapter (`adapter_model.safetensors`, ~74 MB) plus tokenizer files. It cannot be loaded with `AutoModelForCausalLM.from_pretrained("Nanthasit/sakthai-coder-browser-lora")` alone β€” you must load the base model first, then attach the adapter with `PeftModel` (see below).
55
+
56
+ ### Browser actions via `<tool_call>` XML
57
+
58
+ The model is trained to emit structured tool calls for browser automation:
59
+
60
+ - `browser_navigate(url)` β€” navigate to a URL
61
+ - `browser_click(element)` β€” click a UI element
62
+ - `browser_type(element, text)` β€” type text into a field
63
+ - `browser_extract()` β€” extract page content
64
+
65
+ ```xml
66
+ <tool_call>{"name": "browser_navigate", "arguments": {"url": "https://news.google.com"}}</tool_call>
67
+ ```
68
 
69
  ---
70
 
71
+ ## How to Use (PEFT)
72
 
73
  ```python
74
  import torch
 
83
  tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
84
 
85
  model = PeftModel.from_pretrained(model, "Nanthasit/sakthai-coder-browser-lora")
86
+
87
+ # To produce a standalone merged model:
88
+ # model = model.merge_and_unload()
89
 
90
  messages = [
91
+ {"role": "system", "content": "You are SakThai Browser Agent. Use <tool_call> blocks to control the browser."},
92
  {"role": "user", "content": "Go to google.com and search for AI news."},
93
  ]
94
  inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
 
96
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
97
  ```
98
 
99
+ ### llama.cpp / GGUF path
100
+
101
+ No GGUF of this adapter exists β€” quantize the **merged** model instead:
102
+ 1. Load base + adapter and call `merge_and_unload()` (snippet above)
103
+ 2. Save the merged weights
104
+ 3. Convert to GGUF with `llama.cpp/convert_hf_to_gguf.py`, or use the pre-built [sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf)
105
+
106
+ ---
107
+
108
+ ## Adapter Configuration (verified from `adapter_config.json`)
109
+
110
+ | Setting | Value |
111
+ |---------|-------|
112
+ | **PEFT type** | `LORA` |
113
+ | **PEFT version** | 0.20.0 |
114
+ | **Rank (r)** | 16 |
115
+ | **Alpha** | 32 |
116
+ | **Dropout** | **0.05** βœ… (previously misdocumented as 0.1) |
117
+ | **rsLoRA** | `true` (use_rslora) |
118
+ | **Target modules** | **All 7 linear projections**: `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` βœ… (previously misdocumented as q/k/v/o only) |
119
+ | **Bias** | none |
120
+ | **DoRA** | false |
121
+ | **Task type** | `CAUSAL_LM` |
122
+ | **Trainable params** | 36,955,556 (~37M) |
123
+ | **Adapter size** | 73,911,112 B (73.9 MB, BF16) |
124
+
125
  ---
126
 
127
  ## Training Details
128
 
129
  | Detail | Value |
130
  |--------|-------|
131
+ | **Base model** | Qwen/Qwen2.5-Coder-1.5B-Instruct |
132
+ | **Method** | SFT with LoRA (PEFT) |
133
+ | **Dataset** | [SimpleToolCalling](https://huggingface.co/datasets/Nanthasit/SimpleToolCalling) + [sakthai-combined-v7](https://huggingface.co/datasets/Nanthasit/sakthai-combined-v7) |
134
  | **Optimizer** | AdamW (8-bit) |
135
  | **Learning rate** | 2e-4 |
136
  | **Batch size** | 4 (gradient accumulation: 4) |
137
  | **Epochs** | 3 |
138
+ | **Context length** | 32,768 tokens |
139
+ | **Precision** | BF16 |
140
  | **Hardware** | Free T4 GPU (Kaggle / Colab) |
141
  | **Framework** | TRL 0.19.1, Transformers 5.14.1, PyTorch 2.13.0 |
142
 
143
+ ### Base architecture (Qwen2.5-Coder-1.5B-Instruct, verified)
144
+
145
+ | Attribute | Value |
146
+ |-----------|-------|
147
+ | Architecture | `Qwen2ForCausalLM` |
148
+ | Hidden size | 1,536 |
149
+ | Layers | 28 |
150
+ | Attention heads | 12 |
151
+ | KV heads (GQA) | 2 |
152
+ | Intermediate size | 8,960 |
153
+ | Vocab size | 151,936 |
154
+ | Max position embeddings | 32,768 |
155
+ | Total parameters | 1,543,714,304 (1.54B) |
156
+
157
+ ---
158
+
159
+ ## Evaluation & Status
160
+
161
+ **Benchmarks are pending β€” honestly.** This is a LoRA adapter, so inference benchmarking requires merging onto the base model first; that has not been completed yet, so there is **no model-index entry** (results will be added once the merged model is benchmarked).
162
+
163
+ Repo-verified status (from [`.eval_results/cron-eval-sakthai-coder-browser-lora-2026-07-31-1.yaml`](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora/blob/main/.eval_results/cron-eval-sakthai-coder-browser-lora-2026-07-31-1.yaml), 2026-07-31):
164
+
165
+ | Metric | Value |
166
+ |--------|-------|
167
+ | Card quality | 84/100 |
168
+ | Repo hygiene | 95/100 |
169
+ | Health score | 31.1/100 |
170
+ | Downloads rank | 17/19 (0 downloads β€” new model, published 2026-07-30) |
171
+ | Velocity rank | 17/19 |
172
+ | Eval findings | Fixed: dropout 0.1→0.05, target modules q/k/v/o→all 7 (this card) |
173
+
174
+ ---
175
+
176
+ ## SakThai Model Family
177
+
178
+ | Model | Size | Role | Downloads |
179
+ |:------|:----:|:-----|:---------:|
180
+ | **Coder Browser LoRA** β¬… | 73.9 MB | **Training-time adapter (this repo)** | 0 |
181
+ | Coder Browser (merged) | 3.1 GB | Merged browser agent | 0 |
182
+ | Coder Browser GGUF | GGUF | llama.cpp / Ollama quant | 0 |
183
+ | Coder 1.5B | 1.5B | Code assistant | 93 |
184
+ | Context 1.5B Merged v2 | 1.5B | Flagship tool-calling v2 | 0 |
185
+ | Context 1.5B Merged | 1.5B | Flagship v1 | 1,599 |
186
+ | Context 1.5B Tools v2 | LoRA | Tool-calling v2 adapter | 0 |
187
+ | Context 1.5B Tools | LoRA | Tool-calling v1 adapter | 349 |
188
+ | Plus 1.5B | 1.5B | All-rounder | 0 |
189
+ | Plus 1.5B LoRA | LoRA | All-rounder adapter | 0 |
190
+ | Plus 1.5B Coder | 1.5B | Coder variant | 0 |
191
+ | Context 0.5B Merged | 380 MB | Lightweight / edge | 1,370 |
192
+ | Context 0.5B Tools | LoRA | Edge tool-calling | 94 |
193
+ | Context 7B Merged | 15 GB | Full-power reasoning | 744 |
194
+ | Context 7B Tools | LoRA | 7B tool-calling | 399 |
195
+ | Context 7B 128K | recipe | YaRN long-context | 506 |
196
+ | Vision 7B | 7B | Vision-language | 186 |
197
+ | Embedding Multilingual | 470 MB | Embeddings | 362 |
198
+ | TTS Model | 82M | Kokoro TTS | 150 |
199
+
200
+ *Live download counts via Hub API, 2026-07-31. [Full collection](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02)*
201
+
202
  ---
203
 
204
+ ## Limitations
205
 
206
+ - **Adapter-only repo** β€” requires the base model + PEFT to run; not directly servable via the serverless Inference API
207
+ - English-only coverage
208
+ - 1.5B parameter ceiling on complex reasoning tasks
209
+ - Browser actions are trained as `<tool_call>` XML β€” downstream parser required
210
+ - No formal benchmark results yet (merge-then-eval planned)
211
 
212
  ---
213
 
214
+ *Part of the [SakThai Model Family](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02). Built with love, tears, and zero budget. From a shelter in Cork, Ireland, to the world.*