Downloads · 30 days
0
Devadripta/csf425-phase2-qwen-toolalpaca
csf425-phase2-qwen-toolalpaca is a machine learning model from Devadripta. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
- Not suitable for general-purpose conversation - Not intended for use without a paired tool executor - May hallucinate tool names outside its training distribution
Downloads · 30 days
0
Access
Public
Updated Apr 17, 2026
Repo size
51.8 MB
Likes
0
Public
Click a slice to open those files.
.safetensors40.4 MB · 78%
From the Hugging Face model README
Fine-tuned on the ToolAlpaca dataset — ~4,098 formatted examples of tool-use trajectories across 468 real-world APIs covering categories like Development, Finance, Weather, Search, and more.
| Parameter | Value |
|---|---|
| Base model | Qwen2.5-7B-Instruct |
| Quantization | 4-bit NF4 (QLoRA) |
| LoRA rank (r) | 16 |
| LoRA alpha | 32 |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| LoRA dropout | 0.05 |
| Epochs | 3 |
| Per-device batch size | 2 |
| Gradient accumulation | 8 (effective batch = 16) |
| Learning rate | 2e-4 |
| LR scheduler | Cosine |
| Warmup steps | 50 |
| Max sequence length | 512 |
| Optimizer | paged_adamw_8bit |
| Training regime | fp16 mixed precision |
| Epoch | Training Loss | Validation Loss |
|---|---|---|
| 1 | 0.6009 | 0.6724 |
| 2 | 0.4598 | 0.8021 |
| 3 | 0.4083 | 0.8582 |
Best model at Epoch 1 (lowest validation loss: 0.6724).
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
BASE_MODEL = "Qwen/Qwen2.5-7B-Instruct"
LORA_PATH = "Devadripta/csf425-phase2-qwen-toolalpaca"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16
)
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL, quantization_config=bnb_config,
device_map="auto", trust_remote_code=True
)
model = PeftModel.from_pretrained(base_model, LORA_PATH)
model.eval()
prompt = "System: You are a data analysis agent.\nUser: What is the total revenue for 2022?\nAssistant:\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=200, do_sample=False)
print(tokenizer.decode(outputs, skip_special_tokens=True))
BITS Pilani | CSF425 Deep Learning | April 2026