File size: 6,240 Bytes
44b83d8
 
 
 
 
6cfca85
44b83d8
6cfca85
44b83d8
 
 
 
 
 
 
05a2a9f
44b83d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6cfca85
44b83d8
 
 
 
 
 
 
 
 
 
 
05a2a9f
44b83d8
6cfca85
44b83d8
 
6cfca85
44b83d8
6cfca85
44b83d8
6cfca85
44b83d8
6cfca85
44b83d8
 
 
05a2a9f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6cfca85
05a2a9f
 
6cfca85
05a2a9f
6cfca85
05a2a9f
44b83d8
 
6cfca85
 
 
 
05a2a9f
 
44b83d8
 
 
 
 
05a2a9f
 
 
44b83d8
 
 
05a2a9f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44b83d8
 
 
05a2a9f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6cfca85
05a2a9f
 
 
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.29'

timestamp: '20250411_235544461_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: /static-proxy?url=https%3A%2F%2Fcdn-avatars.huggingface.co%2Fv1%2Fproduction%2Fuploads%2F651e93137b2a2e027f9e55df%2F96hzBved0YMjCq--s0kad.png%3C%2Fspan%3E


# @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: '101'

# @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: fa58022553264b9c59d724f2cd42849c6ed92920
    metrics:
      - type: precision
        value: 0.7681936025619507
      - type: recall
        value: 0.767867922782898
      - type: f1
        value: 0.7676968574523926
      - type: jaccard
        value: 0.7502401471138

---

<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.29</code>  -  <code>2025-04-11 23:55:44 UTC</code>
  (retraining
  <a target="_blank"
     href="https://huggingface.co/retrain-pipelines/function_caller_lora/tree/retrain-pipelines_source-code/v0.29_20250411_235544461_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.29_20250411_235544461_UTC">pipeline-card</a>)
</div>

Training dataset&nbsp;:
- <code>retrain-pipelines/func_calls_ds v0.28</code>
(<a href="https://huggingface.co/datasets/retrain-pipelines/func_calls_ds/blob/fa58022553264b9c59d724f2cd42849c6ed92920/README.md"
    target="_blank">fa58022</a> -
    2025-04-11 16:23:27 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>101</code>
  </div>
</div>