Nanthasit commited on
Commit
4d80bbb
·
verified ·
1 Parent(s): b3dbc5a

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +68 -144
README.md CHANGED
@@ -1,192 +1,116 @@
1
  ---
 
 
 
2
  library_name: transformers
3
  pipeline_tag: text-generation
4
- license: apache-2.0
5
- base_model: Qwen/Qwen2.5-1.5B-Instruct
6
  tags:
7
- - qwen2
8
- - text-generation
9
- - conversational
10
- - tool-use
11
  - browser-automation
12
  - web-agent
 
13
  - function-calling
14
- - safetensors
15
- - transformers
16
- - finetune
17
- - sakthai
18
- - house-of-sak
 
 
19
  datasets:
20
  - Nanthasit/SimpleToolCalling
21
  - Nanthasit/sakthai-combined-v7
22
- widget:
23
- - messages:
24
- - role: system
25
- content: You are a browser automation assistant. You can browse the web, click elements, type text, and extract information from pages.
26
- - role: user
27
- content: Search for the latest AI news and summarize the top story.
28
  ---
29
 
30
  # SakThai Coder Browser
31
 
32
- ![downloads](https://img.shields.io/badge/dynamic/json?label=downloads&query=%24.downloads&url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fmodels%2FNanthasit%2Fsakthai-coder-browser)
33
-
34
- A **Qwen2.5-1.5B** model fine-tuned for **browser automation and web interaction tasks**. This model understands web browsing instructions and can generate structured tool calls to control a browser, making it suitable for AI web agents and automation pipelines.
35
-
36
- Part of the **SakThai** model family — a collection of compact, edge-deployable models by the House of Sak.
37
-
38
- ## Model Details
39
 
40
- | Property | Value |
41
- |----------|-------|
42
- | **Base Model** | Qwen/Qwen2.5-1.5B-Instruct |
43
- | **Architecture** | Qwen2ForCausalLM |
44
- | **Parameters** | 1.5B |
45
- | **Context Length** | 32,768 tokens |
46
- | **Format** | bfloat16 |
47
- | **Chat Template** | Qwen2 chat format with `<tool_call>` XML tool calling |
48
- | **Pipeline** | Text Generation |
49
 
50
- ### Model Sources
51
-
52
- | Source | Link |
53
- |--------|------|
54
- | **LoRA Adapter** | [Nanthasit/sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) |
55
- | **GGUF Quant** | [Nanthasit/sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) |
56
- | **SakThai Family** | [sakthai-model-family](https://huggingface.co/collections/Nanthasit/sakthai-model-family-67e7b8c9f0a1b2c3d4e5f6a7) |
57
-
58
- ## Uses
59
-
60
- ### Direct Use
61
 
62
- Use this model for:
63
- - **Browser automation** — instruct the model to navigate pages, click elements, fill forms, extract content
64
- - **Web QA** — ask questions about web page content
65
- - **Tool-use agents** — the model is trained to emit structured `<tool_call>` JSON for function execution
66
 
67
- ### Out-of-Scope Use
68
 
69
- - Unstructured open-ended chat without tool calling context
70
- - Tasks requiring visual understanding (this is text-only; use [sakthai-vision-7b](https://huggingface.co/Nanthasit/sakthai-vision-7b) for vision tasks)
 
 
 
71
 
72
- ## How to Get Started with the Model
73
 
74
- ### Using Transformers
75
 
76
  ```python
77
- import torch
78
  from transformers import AutoModelForCausalLM, AutoTokenizer
 
79
 
80
- model_name = "Nanthasit/sakthai-coder-browser"
81
-
82
- tokenizer = AutoTokenizer.from_pretrained(model_name)
83
  model = AutoModelForCausalLM.from_pretrained(
84
- model_name,
85
  torch_dtype=torch.bfloat16,
86
- device_map="auto",
87
  )
 
88
 
89
  messages = [
90
- {"role": "system", "content": "You are a browser automation assistant. You can browse the web, click elements, type text, and extract information from pages."},
91
  {"role": "user", "content": "Search for the latest AI news and summarize the top story."},
92
  ]
93
-
94
- text = tokenizer.apply_chat_template(
95
- messages,
96
- tokenize=False,
97
- add_generation_prompt=True,
98
- )
99
- inputs = tokenizer([text], return_tensors="pt").to(model.device)
100
- outputs = model.generate(
101
- **inputs,
102
- max_new_tokens=1024,
103
- temperature=0.7,
104
- top_p=0.8,
105
- repetition_penalty=1.1,
106
- )
107
- response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
108
- print(response)
109
  ```
110
 
111
- ### Using llama.cpp (GGUF)
112
-
113
- ```bash
114
- # Download the GGUF version
115
- huggingface-cli download Nanthasit/sakthai-coder-browser-gguf sakthai-coder-browser-f16.gguf --local-dir ./
116
-
117
- # Run inference
118
- llama-cli -m sakthai-coder-browser-f16.gguf \
119
- -p "<|im_start|>system\nYou are a browser automation assistant.<|im_end|>\n<|im_start|>user\nSearch for AI news<|im_end|>\n<|im_start|>assistant\n" \
120
- -n 512 -t 8
121
  ```
 
 
 
 
122
 
123
  ## Training Details
124
 
125
- ### Training Data
 
 
 
 
 
 
 
 
 
126
 
127
- This model was fine-tuned on a curated dataset of browser automation trajectories including:
128
- - Web navigation instructions paired with structured tool calls
129
- - Multi-step browsing tasks (click, type, extract, wait, navigate)
130
- - Diverse web page contexts across domains
131
 
132
- Training data draws from **SimpleToolCalling**, **sakthai-combined-v7**, and synthetic browser interaction datasets.
133
 
134
- ### Training Procedure
 
 
 
135
 
136
- - **Fine-tuning method:** Full parameter fine-tuning of Qwen2.5-1.5B-Instruct
137
- - **Precision:** bfloat16 mixed precision
138
- - **Optimizer:** AdamW
139
- - **Learning rate:** 2e-5 with cosine decay
140
- - **Context length:** 32,768 tokens
141
- - **Hardware:** NVIDIA GPU (Kaggle/Colab)
142
 
143
  ## Evaluation
144
 
145
- ### Recommendations
146
-
147
- - Use with a structured generation parser (e.g., outline JSON from `<tool_call>` tags) for reliable function calling
148
- - For production use, pair with browser automation frameworks (Playwright, Puppeteer, Browser Use)
149
- - Benchmark on your specific browser automation tasks before deployment
150
-
151
- ## Related Models
152
-
153
- | Model | Type | Description |
154
- |-------|------|-------------|
155
- | [sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) | LoRA | LoRA adapter for browser automation (4.3M params) |
156
- | [sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) | GGUF | F16 GGUF quantized version for llama.cpp |
157
- | [sakthai-coder-1.5b](https://huggingface.co/Nanthasit/sakthai-coder-1.5b) | Text Gen | General-purpose code generation variant |
158
- | [sakthai-context-1.5b-tools](https://huggingface.co/Nanthasit/sakthai-context-1.5b-tools) | Text Gen | General tool-use model at 1.5B scale |
159
-
160
- ## Technical Specifications
161
-
162
- ### Model Architecture
163
-
164
- Qwen2 Decoder-only transformer:
165
- - **Hidden size:** 1,536
166
- - **Layers:** 28
167
- - **Attention heads:** 12
168
- - **KV heads:** 2 (grouped-query attention)
169
- - **Intermediate size:** 8,960
170
- - **Vocab size:** 151,936
171
- - **Max position:** 32,768
172
- - **Activation:** SiLU (Swiglu)
173
- - **Normalization:** RMSNorm (eps=1e-6)
174
-
175
- ### Software
176
-
177
- - **Framework:** PyTorch + Transformers v5.14.1
178
- - **Chat template:** Qwen2 format with `<tool_call>` / `<tool_response>` XML
179
-
180
- ## License
181
-
182
- This model is released under **Apache 2.0**, inheriting from Qwen2.5.
183
-
184
- ## Environmental Impact
185
-
186
- - **Hardware Type:** NVIDIA GPU (T4/L4)
187
- - **Hours used:** ~48 hours
188
- - **Compute Region:** US
189
 
190
  ---
191
 
192
- *Created by [Beer (Nanthasit)](https://huggingface.co/Nanthasit) — part of the SakThai Agent Family.*
 
1
  ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
  library_name: transformers
6
  pipeline_tag: text-generation
 
 
7
  tags:
8
+ - qwen2.5
9
+ - qwen2.5-coder
10
+ - sakthai
11
+ - house-of-sak
12
  - browser-automation
13
  - web-agent
14
+ - tool-calling
15
  - function-calling
16
+ - agent
17
+ - code-generation
18
+ - finetuned
19
+ - sft
20
+ - text-generation
21
+ - merged
22
+ base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
23
  datasets:
24
  - Nanthasit/SimpleToolCalling
25
  - Nanthasit/sakthai-combined-v7
 
 
 
 
 
 
26
  ---
27
 
28
  # SakThai Coder Browser
29
 
30
+ <p align="center">
31
+ <strong>Browser automation agent — Qwen2.5-Coder-1.5B-Instruct fine-tuned for web interaction</strong><br/>
32
+ <em>Part of the <a href="https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02">SakThai Model Family</a></em>
33
+ </p>
 
 
 
34
 
35
+ <p align="center">
36
+ <a href="https://huggingface.co/Nanthasit"><img src="https://img.shields.io/badge/%F0%9F%A4%97-Nanthasit-6644cc" alt="Profile"/></a>
37
+ <a href="https://github.com/beer-sakthai"><img src="https://img.shields.io/badge/GitHub-beer--sakthai-181717?logo=github" alt="GitHub"/></a>
38
+ <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>
39
+ <img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"/>
40
+ <img src="https://img.shields.io/badge/task-browser%20automation-ff6b6b" alt="Task"/>
41
+ </p>
 
 
42
 
43
+ ---
 
 
 
 
 
 
 
 
 
 
44
 
45
+ ## Model Description
 
 
 
46
 
47
+ SakThai Coder Browser transforms Qwen2.5-Coder-1.5B-Instruct into a **browser automation assistant** that outputs structured `<tool_call>` XML for web interaction. It can navigate pages, click elements, type text, and extract content — designed to work with browser automation frameworks.
48
 
49
+ **Available actions via `<tool_call>` XML:**
50
+ - `browser_navigate(url)` — navigate to a URL
51
+ - `browser_click(element)` — click a UI element
52
+ - `browser_type(element, text)` — type text into a field
53
+ - `browser_extract()` — extract page content
54
 
55
+ ---
56
 
57
+ ## Quick Start
58
 
59
  ```python
 
60
  from transformers import AutoModelForCausalLM, AutoTokenizer
61
+ import torch
62
 
 
 
 
63
  model = AutoModelForCausalLM.from_pretrained(
64
+ "Nanthasit/sakthai-coder-browser",
65
  torch_dtype=torch.bfloat16,
66
+ device_map="auto"
67
  )
68
+ tokenizer = AutoTokenizer.from_pretrained("Nanthasit/sakthai-coder-browser")
69
 
70
  messages = [
71
+ {"role": "system", "content": "You are SakThai Browser Agent. Use <tool_call> blocks to control the browser."},
72
  {"role": "user", "content": "Search for the latest AI news and summarize the top story."},
73
  ]
74
+ inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
75
+ outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
76
+ print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  ```
78
 
79
+ Expected output format:
 
 
 
 
 
 
 
 
 
80
  ```
81
+ <tool_call>{"name": "browser_navigate", "arguments": {"url": "https://news.google.com"}}</tool_call>
82
+ ```
83
+
84
+ ---
85
 
86
  ## Training Details
87
 
88
+ | Detail | Value |
89
+ |--------|-------|
90
+ | **Base model** | Qwen/Qwen2.5-Coder-1.5B-Instruct |
91
+ | **Method** | Full parameter fine-tuning via SFT |
92
+ | **Training data** | SimpleToolCalling + sakthai-combined-v7 |
93
+ | **Optimizer** | AdamW |
94
+ | **Learning rate** | 2e-5 (cosine decay) |
95
+ | **Context length** | 32,768 tokens |
96
+ | **Precision** | BF16 |
97
+ | **Hardware** | Free T4 GPU (Kaggle / Colab) |
98
 
99
+ ---
 
 
 
100
 
101
+ ## Sibling Models
102
 
103
+ | Variant | Repository |
104
+ |:--------|:-----------|
105
+ | **LoRA Adapter** (unmerged) | [sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) |
106
+ | **Merged model** (this repo) ⬅ | [sakthai-coder-browser](https://huggingface.co/Nanthasit/sakthai-coder-browser) |
107
 
108
+ ---
 
 
 
 
 
109
 
110
  ## Evaluation
111
 
112
+ **Benchmarks are pending.** Formal evaluation on browser automation tasks coming soon.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
  ---
115
 
116
+ *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.*