File size: 6,242 Bytes
d921ed9
 
 
 
 
0dc9460
d921ed9
0dc9460
d921ed9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0dc9460
d921ed9
 
 
 
 
 
 
 
 
 
 
 
 
0dc9460
d921ed9
 
0dc9460
d921ed9
0dc9460
d921ed9
0dc9460
d921ed9
0dc9460
d921ed9
 
 
363ec61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0dc9460
363ec61
 
0dc9460
363ec61
0dc9460
363ec61
d921ed9
 
0dc9460
 
 
 
363ec61
 
d921ed9
 
 
 
 
363ec61
 
 
d921ed9
 
 
363ec61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d921ed9
 
 
363ec61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0dc9460
363ec61
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
---
# @see https://github.com/huggingface/hub-docs/blob/main/modelcard.md
# @see https://huggingface.co/docs/huggingface_hub/guides/model-cards#update-metadata
# @see https://huggingface.co/docs/hub/model-cards#model-card-metadata

version: '0.24'

timestamp: '20250405_014920180_UTC'

model_name: retrain-pipelines Function Caller

base_model: unsloth/Qwen2.5-1.5B
base_model_relation: adapter
library_name: transformers
datasets:
- retrain-pipelines/func_calls_ds

license: apache-2.0

language:
- en

task_categories:
- text2text-generation

tags:
- retrain-pipelines
- function-calling
- LLM Agent
- code
- unsloth

thumbnail: https://cdn-avatars.huggingface.co/v1/production/uploads/651e93137b2a2e027f9e55df/96hzBved0YMjCq--s0kad.png


# @see https://huggingface.co/docs/hub/models-widgets#enabling-a-widget
# @see https://huggingface.co/docs/hub/models-widgets-examples
# @see https://huggingface.co/docs/hub/en/model-cards#specifying-a-task--pipelinetag-
pipeline_tag: text2text-generation
widget:
  - text: >-
      Hello
    example_title: No function call
    output:
      text: '[]'
  - text: >-
      Is 49 a perfect square?
    example_title: Perfect square
    output:
      text: '[{"name": "is_perfect_square", "arguments": {"num": 49}}]'

mf_run_id: '95'

# @see https://huggingface.co/docs/huggingface_hub/guides/model-cards#include-evaluation-results
# @see https://huggingface.co/docs/huggingface_hub/main/en/package_reference/cards#huggingface_hub.EvalResult
model-index:
- name: retrain-pipelines Function Caller
  results:
  - task:
      type: text2text-generation
      name: Text2Text Generation
    dataset:
      name: retrain-pipelines Function Calling
      type: retrain-pipelines/func_calls_ds
      split: validation
      revision: acf61743e7c3e846b74162444f86e65852d2bbf6
    metrics:
      - type: precision
        value: 0.7742409706115723
      - type: recall
        value: 0.7735999822616577
      - type: f1
        value: 0.7736773490905762
      - type: jaccard
        value: 0.7556698322296143

---

<div 
  class="
    p-6 mb-4 rounded-lg 
    pt-6 sm:pt-9
    bg-gradient-to-b
    from-purple-500 
    dark:from-purple-500/20
  "
>
  <div 
    class="
      pl-4 rounded-lg 
      border-2 border-gray-100 
      bg-gradient-to-b
      from-purple-500 
      dark:from-purple-500/20
    "
  >
    <b>retrain-pipelines Function Caller</b>
</div>
  <code>version 0.24</code>  -  <code>2025-04-05 01:49:20 UTC</code>
  (retraining
  <a target="_blank"
     href="https://huggingface.co/retrain-pipelines/function_caller_lora/tree/retrain-pipelines_source-code/v0.24_20250405_014920180_UTC">source-code</a> |
  <a target="_blank"
     href="https://huggingface.co/spaces/retrain-pipelines/online_pipeline_card_renderer/?model_repo_id=retrain-pipelines/function_caller_lora&version_id=v0.24_20250405_014920180_UTC">pipeline-card</a>)
</div>

Training dataset&nbsp;:
- <code>retrain-pipelines/func_calls_ds v0.23</code>
(<a href="https://huggingface.co/datasets/retrain-pipelines/func_calls_ds/blob/acf61743e7c3e846b74162444f86e65852d2bbf6/README.md"
    target="_blank">acf6174</a> -
    2025-04-04 18:05:46 UTC)
    <br />
    <img alt="" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fdatasets%2Fretrain-pipelines/func_calls_ds&amp;query=%24.downloads&amp;logo=huggingface&amp;label=downloads"  class="inline-block" />&nbsp;<img alt="" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fdatasets%2Fretrain-pipelines/func_calls_ds&amp;query=%24.likes&amp;logo=huggingface&amp;label=likes"  class="inline-block" />

Base model&nbsp;:
- <code>unsloth/Qwen2.5-1.5B</code>
(<a href="https://huggingface.co/unsloth/Qwen2.5-1.5B/blob/2d0a015faee2c1af360a6725a30c4d7a258ac4d4/README.md"
    target="_blank">2d0a015</a> -
    2025-02-06 02:32:14 UTC)
    <br />
    <img alt="" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fmodels%2Funsloth/Qwen2.5-1.5B&amp;query=%24.downloads&amp;logo=huggingface&amp;label=downloads"  class="inline-block" />&nbsp;<img alt="" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fmodels%2Funsloth/Qwen2.5-1.5B&amp;query=%24.likes&amp;logo=huggingface&amp;label=likes"  class="inline-block" /><br />
arxiv&nbsp;:<br />
  - <code><a href="https://huggingface.co/papers/2407.10671"
             target="_blank">2407.10671</a></code><br />
The herein LoRa adapter can for instance be used as follows&nbsp;:<br />
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from torch import device, cuda

repo_id = "retrain-pipelines/function_caller_lora"
revision = "<model_revision_commit_hash>"
model = AutoModelForCausalLM.from_pretrained(
    repo_id, revision=revision, torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(
    repo_id, revision=revision, torch_dtype="auto", device_map="auto")

device = device("cuda" if cuda.is_available() else "cpu")
def generate_tool_calls_list(query, max_new_tokens=400) -> str:
    formatted_query = tokenizer.chat_template.format(query, "")
    inputs = tokenizer(formatted_query, return_tensors="pt").input_ids.to(device)
    outputs = model.generate(inputs, max_new_tokens=max_new_tokens, do_sample=False)
    generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
    return generated_text[len(formatted_query):].strip()

generate_tool_calls_list("Is 49 a perfect square ?")
```

<br />
<br />

<div 
  class="
    p-6 mb-4 rounded-lg 
    pt-6 sm:pt-9
    px-4
    pb-1 
    bg-gradient-to-t
    from-purple-500 
    dark:from-purple-500/20
  "
>
  <div 
    class="
      p-6 mb-4 rounded-lg 
      border-2 border-gray-100 
      pt-6 sm:pt-9
      bg-gradient-to-t
      from-purple-500 
      dark:from-purple-500/20
    "
  >
    Powered by
    <code><a target="_blank"
             href="https://github.com/aurelienmorgan/retrain-pipelines">retrain-pipelines
          0.1.1</a></code> - 
    <code>Run by <a target="_blank" href="https://huggingface.co/Aurelien-Morgan-Bot">Aurelien-Morgan-Bot</a></code> -
    <em><b>UnslothFuncCallFlow</b></em> - mf_run_id&nbsp;: <code>95</code>
  </div>
</div>