TymofiiNasobko commited on
Commit
4ae20bb
·
verified ·
1 Parent(s): defc7d7

TymofiiNasobko/Lapa-function-calling

Browse files
README.md CHANGED
@@ -4,8 +4,8 @@ library_name: transformers
4
  model_name: Lapa-function-calling
5
  tags:
6
  - generated_from_trainer
7
- - sft
8
  - trl
 
9
  licence: license
10
  ---
11
 
@@ -34,10 +34,10 @@ This model was trained with SFT.
34
 
35
  ### Framework versions
36
 
37
- - TRL: 0.25.1
38
  - Transformers: 4.57.3
39
  - Pytorch: 2.6.0+cu118
40
- - Datasets: 4.4.1
41
  - Tokenizers: 0.22.1
42
 
43
  ## Citations
 
4
  model_name: Lapa-function-calling
5
  tags:
6
  - generated_from_trainer
 
7
  - trl
8
+ - sft
9
  licence: license
10
  ---
11
 
 
34
 
35
  ### Framework versions
36
 
37
+ - TRL: 0.26.2
38
  - Transformers: 4.57.3
39
  - Pytorch: 2.6.0+cu118
40
+ - Datasets: 4.4.2
41
  - Tokenizers: 0.22.1
42
 
43
  ## Citations
adapter_config.json CHANGED
@@ -16,7 +16,7 @@
16
  "layers_pattern": null,
17
  "layers_to_transform": null,
18
  "loftq_config": {},
19
- "lora_alpha": 512,
20
  "lora_bias": false,
21
  "lora_dropout": 0.05,
22
  "megatron_config": null,
@@ -28,20 +28,20 @@
28
  "peft_type": "LORA",
29
  "peft_version": "0.18.0",
30
  "qalora_group_size": 16,
31
- "r": 256,
32
  "rank_pattern": {},
33
  "revision": null,
34
  "target_modules": [
35
- "o_proj",
36
- "v_proj",
37
- "down_proj",
38
- "fc2",
39
- "q_proj",
40
  "out_proj",
 
 
 
41
  "fc1",
42
- "up_proj",
43
- "gate_proj",
44
- "k_proj"
45
  ],
46
  "target_parameters": null,
47
  "task_type": "CAUSAL_LM",
 
16
  "layers_pattern": null,
17
  "layers_to_transform": null,
18
  "loftq_config": {},
19
+ "lora_alpha": 32,
20
  "lora_bias": false,
21
  "lora_dropout": 0.05,
22
  "megatron_config": null,
 
28
  "peft_type": "LORA",
29
  "peft_version": "0.18.0",
30
  "qalora_group_size": 16,
31
+ "r": 16,
32
  "rank_pattern": {},
33
  "revision": null,
34
  "target_modules": [
35
+ "gate_proj",
36
+ "up_proj",
 
 
 
37
  "out_proj",
38
+ "fc2",
39
+ "k_proj",
40
+ "down_proj",
41
  "fc1",
42
+ "v_proj",
43
+ "o_proj",
44
+ "q_proj"
45
  ],
46
  "target_parameters": null,
47
  "task_type": "CAUSAL_LM",
adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d5bd45b8610d7433d4628cc89c58265703031a5b658a642c73bf3bb7de3c0ffd
3
- size 8774281960
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a94bd8ade22dbd4bc7fdfe61013744587d42bd243f5aec473266e2205c404b8
3
+ size 4324333160
chat_template.jinja CHANGED
@@ -1,15 +1,45 @@
1
  {{ bos_token }}
2
- {%- if messages[0]['role'] == 'system' -%}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  {%- if messages[0]['content'] is string -%}
4
- {%- set first_user_prefix = messages[0]['content'] + '
5
- ' -%}
6
  {%- else -%}
7
- {%- set first_user_prefix = messages[0]['content'][0]['text'] + '
8
- ' -%}
9
  {%- endif -%}
10
- {%- set loop_messages = messages[1:] -%}
 
11
  {%- else -%}
12
- {%- set first_user_prefix = "" -%}
13
  {%- set loop_messages = messages -%}
14
  {%- endif -%}
15
  {%- for message in loop_messages -%}
@@ -18,12 +48,25 @@
18
  {%- else -%}
19
  {%- set role = message['role'] -%}
20
  {%- endif -%}
21
-
22
  {{ '<start_of_turn>' + role + '
23
- ' + (first_user_prefix if loop.first else "") }}
24
  {%- if message['content'] is string -%}
25
  {%- if role == "model" -%}
26
- {% generation %}{{ message['content'] | trim }}{% endgeneration %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  {%- else -%}
28
  {{ message['content'] | trim }}
29
  {%- endif -%}
@@ -33,7 +76,21 @@
33
  {{ '<start_of_image>' }}
34
  {%- elif item['type'] == 'text' -%}
35
  {%- if role == "model" -%}
36
- {% generation %}{{ item['text'] | trim }}{% endgeneration %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  {%- else -%}
38
  {{ item['text'] | trim }}
39
  {%- endif -%}
@@ -51,7 +108,6 @@
51
  ' }}
52
  {%- endif -%}
53
  {%- endfor -%}
54
-
55
  {%- if add_generation_prompt -%}
56
  {{'<start_of_turn>model
57
  '}}
 
1
  {{ bos_token }}
2
+ {%- if tools -%}
3
+ {%- set loop_messages = messages[1:] -%}
4
+ {{- '<start_of_turn>' + 'system' + '
5
+ ' -}}
6
+ {%- if messages[0]['role'] == "system" -%}
7
+ {%- if messages[0]['content'] is string -%}
8
+ {{- messages[0]['content'] + '
9
+ ' + '
10
+ ' -}}
11
+ {%- else -%}
12
+ {{- messages[0]['content'][0]['text'] + '
13
+ ' + '
14
+ ' -}}
15
+ {%- endif -%}
16
+ {%- endif -%}
17
+ {{- "# Tools
18
+
19
+ You may call one or more functions to assist with the user query.
20
+
21
+ You are provided with function signatures within <tools></tools> XML tags:
22
+ <tools>" -}}
23
+ {%- for tool in tools -%}
24
+ {{- "
25
+ " -}}
26
+ {{- tool | tojson -}}
27
+ {%- endfor -%}
28
+ {"name": "{{ tool_call['name'] }}", "arguments": {{ tool_call['arguments'] | tojson }}}
29
+ {{- '<end_of_turn>' + '
30
+ ' -}}
31
+ {%- elif messages[0]['role'] == "system" -%}
32
+ {%- set loop_messages = messages[1:] -%}
33
+ {{- '<start_of_turn>' + 'system' + '
34
+ ' -}}
35
  {%- if messages[0]['content'] is string -%}
36
+ {{- messages[0]['content'] -}}
 
37
  {%- else -%}
38
+ {{- messages[0]['content'][0]['text'] -}}
 
39
  {%- endif -%}
40
+ {{- '<end_of_turn>
41
+ ' }}
42
  {%- else -%}
 
43
  {%- set loop_messages = messages -%}
44
  {%- endif -%}
45
  {%- for message in loop_messages -%}
 
48
  {%- else -%}
49
  {%- set role = message['role'] -%}
50
  {%- endif -%}
 
51
  {{ '<start_of_turn>' + role + '
52
+ ' }}
53
  {%- if message['content'] is string -%}
54
  {%- if role == "model" -%}
55
+ {% generation %}
56
+ {{- message['content'] | trim -}}
57
+ {% if message['tool_calls'] %}
58
+ {% for tool_call in message['tool_calls'] %}
59
+ {% if tool_call['function'] is defined %}
60
+ {% set tool_call = tool_call['function'] %}
61
+ {% endif %}
62
+ {{- "
63
+ " -}}
64
+ <tool_call>
65
+ {"name": "{{ tool_call['name'] }}", "arguments": {{ tool_call['arguments'] | tojson }}}
66
+ </tool_call>
67
+ {%- endfor -%}
68
+ {%- endif -%}
69
+ {% endgeneration %}
70
  {%- else -%}
71
  {{ message['content'] | trim }}
72
  {%- endif -%}
 
76
  {{ '<start_of_image>' }}
77
  {%- elif item['type'] == 'text' -%}
78
  {%- if role == "model" -%}
79
+ {% generation %}
80
+ {{- item['text'] | trim -}}
81
+ {% if message['tool_calls'] %}
82
+ {% for tool_call in message['tool_calls'] %}
83
+ {% if tool_call['function'] is defined %}
84
+ {% set tool_call = tool_call['function'] %}
85
+ {% endif %}
86
+ {{- "
87
+ " -}}
88
+ <tool_call>
89
+ {"name": "{{ tool_call['name'] }}", "arguments": {{ tool_call['arguments'] | tojson }}}
90
+ </tool_call>
91
+ {%- endfor -%}
92
+ {%- endif -%}
93
+ {% endgeneration %}
94
  {%- else -%}
95
  {{ item['text'] | trim }}
96
  {%- endif -%}
 
108
  ' }}
109
  {%- endif -%}
110
  {%- endfor -%}
 
111
  {%- if add_generation_prompt -%}
112
  {{'<start_of_turn>model
113
  '}}
training_args.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:30e1c54445c5beccd239bb6cc38804b3a0439fb2dae5c02ee756d2bb97e018e9
3
- size 5816
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12352aff4b6f68c7f229e2cedca2ed31cbfe6e2546540c2c02f8aff4cdc9e90d
3
+ size 5880