Views
No views yet
transformers,
no PEFT) and the raw LoRA adapter under adapter/. Merge produced with
Unsloth.⚠️ Checkpoint snapshot (~1.67 epochs, step 5000/9000 (56%)); may not be a fully-trained final run.
| Metric | Score |
|---|---|
| Tool-name match — function name(s) match gold | 96.0% |
| Exact match — name and all arguments match | 72.5% |
exact_match is the metric that matters: one wrong argument fails it while barely denting
token accuracy, so a low SFT loss can still mean imperfect calls.<tool_call>{"name": ..., "arguments": {...}}</tool_call> blocks.1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3tok = AutoTokenizer.from_pretrained("anisiraj/tinytune-smollm2-xlam")
4model = AutoModelForCausalLM.from_pretrained("anisiraj/tinytune-smollm2-xlam").eval()
5
6messages = [
7 {"role": "system", "content": "You are a function-calling assistant. Available tools:\n"
8 '{"name": "get_weather", "arguments": {"city": "string"}}'},
9 {"role": "user", "content": "What's the weather in Paris?"},
10]
11inp = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
12out = model.generate(inp, max_new_tokens=128, do_sample=False)
13print(tok.decode(out[0][inp.shape[1]:], skip_special_tokens=True))1from transformers import AutoModelForCausalLM
2from peft import PeftModel
3
4base = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-135M-Instruct")
5model = PeftModel.from_pretrained(base, "anisiraj/tinytune-smollm2-xlam", subfolder="adapter")SFTTrainer: r=16, alpha=32, dropout=0.05, targets =
attention + MLP; completion-only (generation) loss; lr 2e-4 cosine, warmup 0.03,
batch 4 × grad-accum 4. Custom ChatML+tools template (tools in the system turn).