Text Generation
PEFT
Safetensors
English
qwen2.5
qwen2.5-coder
code-generation
browser-automation
web-agent
tool-calling
function-calling
agent
conversational
lora
adapter
sft
trl
sakthai
house-of-sak
Eval Results (legacy)
Eval Results
Instructions to use Nanthasit/sakthai-coder-browser-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Nanthasit/sakthai-coder-browser-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "Nanthasit/sakthai-coder-browser-lora") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -8,12 +8,12 @@ tags:
|
|
| 8 |
- peft
|
| 9 |
- lora
|
| 10 |
- qwen2.5-coder
|
|
|
|
|
|
|
| 11 |
- browser-automation
|
| 12 |
- web-agent
|
| 13 |
- tool-calling
|
| 14 |
- function-calling
|
| 15 |
-
- sakthai
|
| 16 |
-
- house-of-sak
|
| 17 |
- text-generation
|
| 18 |
- finetuned
|
| 19 |
- sft
|
|
@@ -22,125 +22,92 @@ base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
|
|
| 22 |
datasets:
|
| 23 |
- Nanthasit/SimpleToolCalling
|
| 24 |
- Nanthasit/sakthai-combined-v7
|
| 25 |
-
widget:
|
| 26 |
-
- text: Search for the latest AI news and summarize the top story.
|
| 27 |
-
output:
|
| 28 |
-
text: '<tool_call>{"name": "browser_navigate", "arguments": {"url": "https://news.google.com"}}</tool_call>'
|
| 29 |
---
|
| 30 |
|
| 31 |
-
# SakThai Coder Browser
|
| 32 |
-
|
| 33 |
-

|
| 34 |
-

|
| 35 |
-

|
| 36 |
-

|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|---------|------|-------------|
|
| 44 |
-
| LoRA Adapter | **this repo** | Unmerged weights (requires PEFT) |
|
| 45 |
-
| Merged Model | [Nanthasit/sakthai-coder-browser](https://huggingface.co/Nanthasit/sakthai-coder-browser) | Full weights, plug-and-play |
|
| 46 |
-
| GGUF Quant | [Nanthasit/sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) | llama.cpp / CPU-friendly |
|
| 47 |
-
|
| 48 |
-
Part of the [SakThai Model Family](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02).
|
| 49 |
-
|
| 50 |
-
## Model Details
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|----------|-------|
|
| 54 |
-
| **Base Model** | [Qwen/Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct) |
|
| 55 |
-
| **Fine-tuning Method** | LoRA (Low-Rank Adaptation) via SFT |
|
| 56 |
-
| **Adapter Rank (r)** | 16 |
|
| 57 |
-
| **Target Modules** | q_proj, k_proj, v_proj, o_proj |
|
| 58 |
-
| **LoRA Alpha** | 32 |
|
| 59 |
-
| **LoRA Dropout** | 0.1 |
|
| 60 |
-
| **Training Framework** | TRL + Transformers |
|
| 61 |
-
| **Context Length** | 32,768 tokens |
|
| 62 |
-
| **Format** | bfloat16 (adapter weights) |
|
| 63 |
|
| 64 |
-
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
-
-
|
| 70 |
-
-
|
| 71 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
-
|
| 74 |
|
| 75 |
-
##
|
| 76 |
|
| 77 |
```python
|
| 78 |
import torch
|
| 79 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 80 |
from peft import PeftModel
|
| 81 |
|
| 82 |
-
|
| 83 |
-
base_model = AutoModelForCausalLM.from_pretrained(
|
| 84 |
"Qwen/Qwen2.5-Coder-1.5B-Instruct",
|
| 85 |
torch_dtype=torch.bfloat16,
|
| 86 |
device_map="auto"
|
| 87 |
)
|
| 88 |
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
|
| 89 |
|
| 90 |
-
|
| 91 |
-
model =
|
| 92 |
|
| 93 |
-
# 3. Use it
|
| 94 |
messages = [
|
| 95 |
-
{"role": "system", "content": "You are
|
| 96 |
-
{"role": "user", "content": "Go to
|
| 97 |
]
|
| 98 |
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
| 99 |
-
outputs = model.generate(inputs, max_new_tokens=256, temperature=0.7)
|
| 100 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 101 |
```
|
| 102 |
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
```python
|
| 106 |
-
from transformers import pipeline
|
| 107 |
-
pipe = pipeline("text-generation", model="Nanthasit/sakthai-coder-browser")
|
| 108 |
-
result = pipe("Search for Python tutorials", max_new_tokens=128)
|
| 109 |
-
print(result[0]["generated_text"])
|
| 110 |
-
```
|
| 111 |
|
| 112 |
## Training Details
|
| 113 |
|
| 114 |
| Detail | Value |
|
| 115 |
|--------|-------|
|
| 116 |
-
| **Fine-tuning method** |
|
| 117 |
-
| **Dataset** |
|
| 118 |
| **Optimizer** | AdamW (8-bit) |
|
| 119 |
-
| **Learning
|
| 120 |
-
| **Batch
|
| 121 |
| **Epochs** | 3 |
|
| 122 |
| **Hardware** | Free T4 GPU (Kaggle / Colab) |
|
| 123 |
-
| **Framework
|
| 124 |
-
|
| 125 |
-
## The House of Sak
|
| 126 |
-
|
| 127 |
-
This model is part of the **House of Sak** -- an open-source AI ecosystem built from a shelter in Cork, Ireland, with **$0 budget** and no paid GPUs. Every model here was fine-tuned on free compute by one person with no income.
|
| 128 |
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
[Learn more ->](https://github.com/beer-sakthai/Sak-Family-Agent/blob/main/HOUSE_OF_SAK.md)
|
| 132 |
-
|
| 133 |
-
## Related Models
|
| 134 |
-
|
| 135 |
-
- [Nanthasit/sakthai-coder-browser](https://huggingface.co/Nanthasit/sakthai-coder-browser) -- merged model (base + this adapter)
|
| 136 |
-
- [Nanthasit/sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) -- GGUF quantized version for CPU
|
| 137 |
-
- [Nanthasit/sakthai-coder-1.5b](https://huggingface.co/Nanthasit/sakthai-coder-1.5b) -- general-purpose code model
|
| 138 |
-
- [Nanthasit/sakthai-combined-v7](https://huggingface.co/datasets/Nanthasit/sakthai-combined-v7) -- training dataset
|
| 139 |
|
| 140 |
-
##
|
| 141 |
|
| 142 |
-
|
|
|
|
|
|
|
| 143 |
|
| 144 |
---
|
| 145 |
|
| 146 |
-
*Built with love, tears, and zero budget. From a shelter in Cork, Ireland, to the world.*
|
|
|
|
| 8 |
- peft
|
| 9 |
- lora
|
| 10 |
- qwen2.5-coder
|
| 11 |
+
- sakthai
|
| 12 |
+
- house-of-sak
|
| 13 |
- browser-automation
|
| 14 |
- web-agent
|
| 15 |
- tool-calling
|
| 16 |
- function-calling
|
|
|
|
|
|
|
| 17 |
- text-generation
|
| 18 |
- finetuned
|
| 19 |
- sft
|
|
|
|
| 22 |
datasets:
|
| 23 |
- Nanthasit/SimpleToolCalling
|
| 24 |
- Nanthasit/sakthai-combined-v7
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
---
|
| 26 |
|
| 27 |
+
# SakThai Coder Browser — LoRA Adapter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
<p align="center">
|
| 30 |
+
<strong>Unmerged LoRA adapter for browser automation</strong><br/>
|
| 31 |
+
<em>For use with PEFT · Qwen2.5-Coder-1.5B-Instruct base</em>
|
| 32 |
+
</p>
|
| 33 |
|
| 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
|
| 66 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 67 |
from peft import PeftModel
|
| 68 |
|
| 69 |
+
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
| 70 |
"Qwen/Qwen2.5-Coder-1.5B-Instruct",
|
| 71 |
torch_dtype=torch.bfloat16,
|
| 72 |
device_map="auto"
|
| 73 |
)
|
| 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)
|
| 84 |
+
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 |
|
| 111 |
---
|
| 112 |
|
| 113 |
+
*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.*
|