Views
No views yet
| Metric | Score |
|---|---|
| Call F1 | 94.0% |
| Exact Match | 94.0% |
| Name F1 | 99.11% |
| JSON Parse Rate | 100% |
| Args Accuracy | 94.84% |
1from needle.model.run import load_checkpoint, generate
2from needle.model.architecture import SimpleAttentionNetwork
3from needle.dataset.dataset import get_tokenizer
4import jax
5
6params, config = load_checkpoint("needle-kaiya-tools-v3.pkl")
7model = SimpleAttentionNetwork(config)
8tokenizer = get_tokenizer()
9
10result = generate(
11 model, params, tokenizer,
12 "Send an email to maria@example.com",
13 tools='[{"name":"email_api","description":"Send email","parameters":{...}}]',
14 max_gen_len=512, stream=False, constrained=True
15)
16print(result)
17# [{"name":"email_api","arguments":{"action":"send","to":"maria@example.com",...}}]kaiya_tools_dataset_v3.jsonl file contains 5,708 training examples covering
45 tools from the KAIYA ecosystem. Each example includes a query, available tools
(JSON), and the expected tool call answer (JSON).