Views
No views yet
| metric | base | tuned | delta |
|---|---|---|---|
| full_acc | 0.657 | 0.813 | +0.157 |
| name_acc | 0.843 | 0.990 | +0.147 |
| parse_rate | 0.850 | 0.993 | +0.143 |
| halluc_rate | 0.000 | 0.000 | +0.000 |
| metric | base | tuned | delta |
|---|---|---|---|
| full_acc | 0.484 | 0.609 | +0.124 |
| name_acc | 0.717 | 0.942 | +0.225 |
| parse_rate | 0.721 | 0.953 | +0.233 |
| halluc_rate | 0.004 | 0.012 | +0.008 |
<tool_call> JSONlive_simple (real-world queries never seen in training), so the model
learned tool-calling skill, not just xLAM's surface style. Absolute BFCL numbers are lower (expected
for the live set); the delta is the signal.<tool_call> with
the correct function name and arguments, using Qwen3's native tool template.1from transformers import AutoModelForCausalLM, AutoTokenizer
2import re, json
3
4m = AutoModelForCausalLM.from_pretrained("sukhrobnurali/Qwen3-1.7B-xlam-toolcall", torch_dtype="auto", device_map="auto")
5tok = AutoTokenizer.from_pretrained("sukhrobnurali/Qwen3-1.7B-xlam-toolcall")
6
7tools = [{"type": "function", "function": {
8 "name": "get_weather", "description": "Get current weather for a city.",
9 "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
10msgs = [{"role": "user", "content": "What is the weather in Paris?"}]
11prompt = tok.apply_chat_template(msgs, tools=tools, add_generation_prompt=True,
12 enable_thinking=False, tokenize=False)
13enc = tok(prompt, return_tensors="pt", add_special_tokens=False).to(m.device)
14out = m.generate(**enc, max_new_tokens=256, do_sample=False)
15gen = tok.decode(out[0][enc.input_ids.shape[1]:], skip_special_tokens=True)
16print([json.loads(b.strip()) for b in re.findall(r"<tool_call>(.*?)</tool_call>", gen, re.DOTALL)])