DiTy commited on
Commit
7ef360a
·
verified ·
1 Parent(s): 73bbe0f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +405 -193
README.md CHANGED
@@ -1,199 +1,411 @@
1
  ---
 
 
 
 
 
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
4
  ---
 
5
 
6
- # Model Card for Model ID
7
-
8
  <!-- Provide a quick summary of what the model is/does. -->
9
 
10
-
11
-
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model: google/gemma-2-9b-it
3
+ datasets:
4
+ - DiTy/function-calling
5
+ language:
6
+ - ru
7
  library_name: transformers
8
+ license: apache-2.0
9
+ pipeline_tag: text-generation
10
+ tags:
11
+ - conversational
12
+ - gemma2
13
+ - function-calling
14
+ - trl
15
  ---
16
+ # DiTy/gemma-2-9b-it-russian-function-calling-GGUF
17
 
18
+ This model is a fine-tuned version of [google/gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it) for the **Function Calling** task on non-synthetic data,
19
+ fully annotated by humans only, on the Russian version of the <ins>*DiTy/function-calling*</ins> dataset.
20
  <!-- Provide a quick summary of what the model is/does. -->
21
 
22
+ In addition to **safetensors**, the model is available in **GGUF** formats (in this case, you need to download only a single file):
23
+
24
+ | Filename | Quant type | File Size | Description |
25
+ | -------- | ---------- | --------- | ----------- |
26
+ | [gemma-2-9B-it-russian-function-calling-F16.gguf](https://huggingface.co/DiTy/gemma-2-9b-it-russian-function-calling-GGUF/blob/main/gemma-2-9B-it-russian-function-calling-F16.gguf) | F16 | 18.5GB | Base model with float16 |
27
+ | [gemma-2-9B-it-russian-function-calling-Q8_0.gguf](https://huggingface.co/DiTy/gemma-2-9b-it-russian-function-calling-GGUF/blob/main/gemma-2-9B-it-russian-function-calling-Q8_0.gguf) | Q8_0 | 9.83GB | Extremely high quality, generally unneeded but max available quant. |
28
+ | [gemma-2-9B-it-russian-function-calling-Q6_K.gguf](https://huggingface.co/DiTy/gemma-2-9b-it-russian-function-calling-GGUF/blob/main/gemma-2-9B-it-russian-function-calling-Q6_K.gguf) | Q6_K | 7.59GB | Very high quality, near perfect, *recommended*. |
29
+ | [gemma-2-9B-it-russian-function-calling-Q5_K_M.gguf](https://huggingface.co/DiTy/gemma-2-9b-it-russian-function-calling-GGUF/blob/main/gemma-2-9B-it-russian-function-calling-Q5_K_M.gguf) | Q5_K_M | 6.65GB | High quality, very usable. |
30
+ | [gemma-2-9B-it-russian-function-calling-Q5_K_S.gguf](https://huggingface.co/DiTy/gemma-2-9b-it-russian-function-calling-GGUF/blob/main/gemma-2-9B-it-russian-function-calling-Q5_K_S.gguf) | Q5_K_S | 6.48GB | High quality, very usable. |
31
+
32
+
33
+ ## Model card tree
34
+
35
+ * [How prepare your functions (tools) for *Function Calling*](#prepare_func_call)
36
+ * [Just use chat template for generation](#just_chat_template)
37
+ * [Prompt structure and expected content](#roles)
38
+ * [Evaluation of function calling models](#eval)
39
+
40
+ ## Usage (HuggingFace Transformers)
41
+
42
+ Ниже представлены некоторые фрагменты кода о том, как быстро приступить к запуску модели. Сначала установите библиотеку Transformers с помощью:
43
+ ```bash
44
+ pip install -U transformers
45
+ ```
46
+
47
+ ### <a name="prepare_func_call"></a>Prepare your functions for *Function Calling*
48
+
49
+ Вы должны написать функции (инструменты), используемые моделью, в *коде на Python* и обязательно добавить *Python docstrings*, как в примере ниже:
50
+ ```python
51
+ def get_weather(city: str):
52
+ """
53
+ Функция, которая возвращает погоду в заданном городе.
54
+
55
+ Args:
56
+ city: Город, для которого надо узнать погоду.
57
+ """
58
+ import random
59
+
60
+ return "sunny" if random.random() > 0.5 else "rainy"
61
+
62
+
63
+ def get_sunrise_sunset_times(city: str):
64
+ """
65
+ Функция, которая возвращает время восхода и заката для заданного города для текущей даты (дата от пользователя не требуется), в формате списка: [sunrise_time, sunset_time].
66
+
67
+ Args:
68
+ city: Город, в котором можно узнать время восхода и захода солнца.
69
+ """
70
+
71
+ return ["6:00", "18:00"]
72
+ ```
73
+
74
+ ### <a name="just_chat_template"></a>Just use chat template
75
+
76
+ Далее вам нужно загрузить модель и токенизатор:
77
+ ```python
78
+ import torch
79
+ from transformers import AutoTokenizer, AutoModelForCausalLM
80
+ model = AutoModelForCausalLM.from_pretrained(
81
+ "DiTy/gemma-2-9b-it-russian-function-calling-GGUF",
82
+ device_map="auto",
83
+ torch_dtype=torch.bfloat16, # use float16 or float32 if bfloat16 is not available to you.
84
+ cache_dir=PATH_TO_MODEL_DIR, # optional
85
+ )
86
+ tokenizer = AutoTokenizer.from_pretrained(
87
+ "DiTy/gemma-2-9b-it-russian-function-calling-GGUF",
88
+ cache_dir=PATH_TO_MODEL_DIR, # optional
89
+ )
90
+ ```
91
+
92
+ Чтобы получить результат генерации, просто используйте `apply_chat_template`. Чтобы учесть наши написанные функции (инструменты),
93
+ нам нужно передать их в виде списка через атрибут `tools`, а также использовать `add_prompt_generation=True`.
94
+ ```python
95
+ history_messages = [
96
+ {"role": "system", "content": "Ты - полезный помощник, имеющий доступ к следующим функциям. Используйте их при необходимости - "},
97
+ {"role": "user", "content": "Привет, не мог бы ты сказать мне, во сколько в Краснодаре восходит солнце?"}
98
+ ]
99
+ inputs = tokenizer.apply_chat_template(
100
+ history_messages,
101
+ tokenize=False,
102
+ add_generation_prompt=True, # adding prompt for generation
103
+ tools=[get_weather, get_sunrise_sunset_times], # our functions (tools)
104
+ )
105
+ print(inputs)
106
+ ```
107
+
108
+ Тогда наш `inputs` будет выглядеть следующим образом:
109
+ ```
110
+ <bos><start_of_turn>user
111
+ Ты - полезный помощник, имеющий доступ к следующим функциям. Используйте их при необходимости - {
112
+ "name": "get_weather",
113
+ "description": "Функция, которая возвращает погоду в заданном городе.",
114
+ "parameters": {
115
+ "type": "object",
116
+ "properties": {
117
+ "city": {
118
+ "type": "string",
119
+ "description": "Город, для которого надо узнать погоду."
120
+ }
121
+ },
122
+ "required": [
123
+ "city"
124
+ ]
125
+ }
126
+ },
127
+ {
128
+ "name": "get_sunrise_sunset_times",
129
+ "description": "Функция, которая возвращает время восхода и заката для заданного города для текущей даты (дата от пользователя не требуется), в формате списка: [sunrise_time, sunset_time].",
130
+ "parameters": {
131
+ "type": "object",
132
+ "properties": {
133
+ "city": {
134
+ "type": "string",
135
+ "description": "Город, в котором можно узнать время восхода и захода солнца."
136
+ }
137
+ },
138
+ "required": [
139
+ "city"
140
+ ]
141
+ }
142
+ }
143
+
144
+ Привет, не мог бы ты сказать мне, во сколько в Краснодаре восходит солнце?<end_of_turn>
145
+ <start_of_turn>model
146
+ ```
147
+
148
+ Теперь мы можем сгенерировать ответ модели.
149
+ Будьте осторожны, потому что после `apply_chat_template` нет необходимости *добавлять специальные токены* во время токенизации.
150
+ Поэтому используем `add_special_tokens=False`:
151
+ ```python
152
+ terminator_ids = [
153
+ tokenizer.eos_token_id,
154
+ tokenizer.convert_tokens_to_ids("<end_of_turn>"),
155
+ ]
156
+ prompt_ids = tokenizer.encode(inputs, add_special_tokens=False, return_tensors='pt').to(model.device)
157
+ generated_ids = model.generate(
158
+ prompt_ids,
159
+ max_new_tokens=512,
160
+ eos_token_id=terminator_ids,
161
+ bos_token_id=tokenizer.bos_token_id,
162
+ )
163
+ generated_response = tokenizer.decode(generated_ids[0][prompt_ids.shape[-1]:], skip_special_tokens=False) # `skip_special_tokens=False` for debug
164
+ print(generated_response)
165
+ ```
166
+
167
+ Мы получаем генерацию в виде вызова функции:
168
+ ```
169
+ Вызов функции: {"name": "get_sunrise_sunset_times", "arguments": {"city": "Краснодар"}}<end_of_turn>
170
+ ```
171
+
172
+ Отлично, теперь мы можем получать и обрабатывать результаты с помощью нашей *вызываемой функции*, а затем предоставлять модели ответ *функции*:
173
+ ```python
174
+ history_messages = [
175
+ {"role": "system", "content": "Ты - полезный помощник, имеющий доступ к следующим функциям. Используйте их при необходимости - "},
176
+ {"role": "user", "content": "Привет, не мог бы ты сказать мне, во сколько в Краснодаре восходит солнце?"},
177
+ {"role": "function-call", "content": '{"name": "get_sunrise_sunset_times", "arguments": {"city": "Los Angeles"}}'},
178
+ {"role": "function-response", "content": '{"times_list": ["6:00", "18:00"]}'}, # гипотетический ответ от нашей функции
179
+ ]
180
+ inputs = tokenizer.apply_chat_template(
181
+ history_messages,
182
+ tokenize=False,
183
+ add_generation_prompt=True, # добавление запроса для генерации
184
+ tools=[get_weather, get_sunrise_sunset_times], # наши функции (tools)
185
+ )
186
+ print(inputs)
187
+ ```
188
+
189
+ Давайте убедимся, что `inputs` верны:
190
+ ```
191
+ <bos><start_of_turn>user
192
+ Ты - полезный помощник, имеющий доступ к следующим функциям. Используйте их при необходимости - {
193
+ "name": "get_weather",
194
+ "description": "Функция, которая возвращает погоду в заданном городе.",
195
+ "parameters": {
196
+ "type": "object",
197
+ "properties": {
198
+ "city": {
199
+ "type": "string",
200
+ "description": "Город, для которого надо узнать погоду."
201
+ }
202
+ },
203
+ "required": [
204
+ "city"
205
+ ]
206
+ }
207
+ },
208
+ {
209
+ "name": "get_sunrise_sunset_times",
210
+ "description": "Функция, которая возвращает время восхода и заката для заданного города для текущей даты (дата от пользователя не требуется), в формате списка: [sunrise_time, sunset_time].",
211
+ "parameters": {
212
+ "type": "object",
213
+ "properties": {
214
+ "city": {
215
+ "type": "string",
216
+ "description": "Город, в котором можно узнать время восхода и захода солнца."
217
+ }
218
+ },
219
+ "required": [
220
+ "city"
221
+ ]
222
+ }
223
+ }
224
+
225
+ Привет, не мог бы ты сказать мне, во сколько в Краснодаре восходит солнце?<end_of_turn>
226
+ <start_of_turn>model
227
+ Вызов функции: {"name": "get_sunrise_sunset_times", "arguments": {"city": "Краснодар"}}<end_of_turn>
228
+ <start_of_turn>user
229
+ Ответ от функции: {"times_list": ["6:00", "18:00"]}<end_of_turn>
230
+ <start_of_turn>model
231
+ ```
232
+
233
+ Аналогично, мы генерируем ответ модели:
234
+ ```python
235
+ prompt_ids = tokenizer.encode(inputs, add_special_tokens=False, return_tensors='pt').to(model.device)
236
+ generated_ids = model.generate(
237
+ prompt_ids,
238
+ max_new_tokens=512,
239
+ eos_token_id=terminator_ids,
240
+ bos_token_id=tokenizer.bos_token_id,
241
+ )
242
+ generated_response = tokenizer.decode(generated_ids[0][prompt_ids.shape[-1]:], skip_special_tokens=False) # `skip_special_tokens=False` for debug
243
+ print(generated_response)
244
+ ```
245
+
246
+ В результате мы получаем ответ модели:
247
+ ```
248
+ В Краснодаре солнце восходит в 6:00 утра и заходит в 18:00 вечера.<end_of_turn>
249
+ ```
250
+
251
+ ## Usage via transformers `pipeline`
252
+
253
+ <details>
254
+ <summary>
255
+ Generation via pipeline
256
+ </summary>
257
+
258
+ ```python
259
+ from transformers import pipeline
260
+ generation_pipeline = pipeline(
261
+ "text-generation",
262
+ model="DiTy/gemma-2-9b-it-russian-function-calling-GGUF",
263
+ model_kwargs={
264
+ "torch_dtype": torch.bfloat16, # use float16 or float32 if bfloat16 is not supported for you.
265
+ "cache_dir": PATH_TO_MODEL_DIR, # OPTIONAL
266
+ },
267
+ device_map="auto",
268
+ )
269
+ history_messages = [
270
+ {"role": "system", "content": "Ты - полезный помощник, имеющий доступ к следующим функциям. Используйте их при необходимости - "},
271
+ {"role": "user", "content": "Привет, не мог бы ты сказать мне, во сколько в Краснодаре восходит солнце?"},
272
+ {"role": "function-call", "content": '{"name": "get_sunrise_sunset_times", "arguments": {"city": "Краснодар"}}'},
273
+ {"role": "function-response", "content": '{"times_list": ["6:00", "18:00"]}'}
274
+ ]
275
+ inputs = generation_pipeline.tokenizer.apply_chat_template(
276
+ history_messages,
277
+ tokenize=False,
278
+ add_generation_prompt=True,
279
+ tools=[get_weather, get_sunrise_sunset_times],
280
+ )
281
+ terminator_ids = [
282
+ generation_pipeline.tokenizer.eos_token_id,
283
+ generation_pipeline.tokenizer.convert_tokens_to_ids("<end_of_turn>")
284
+ ]
285
+ outputs = generation_pipeline(
286
+ inputs,
287
+ max_new_tokens=512,
288
+ eos_token_id=terminator_ids,
289
+ )
290
+ print(outputs[0]["generated_text"][len(inputs):])
291
+ ```
292
+
293
+ </details>
294
+
295
+ ## <a name="roles"></a>Prompt structure and expected content
296
+
297
+ Для наиболее корректной работы модели предполагается, что будет использоваться `apply_chat_template`.
298
+ Необходимо передать историю сообщений в определенном формате.
299
+ ```python
300
+ history_messages = [
301
+ {"role": "...", "content": "..."},
302
+ ...
303
+ ]
304
+ ```
305
+
306
+ Для использования доступны следующие роли:
307
+
308
+ * `system` - это необязательная роль, ее содержимое всегда размещается в самом начале и перед перечислением функций, доступных модели (инструментов).
309
+ Вы всегда можете воспользоваться стандартным вариантом, который использовался во время обучения: ***"Ты - полезный помощник, имеющий доступ к следующим функциям. Используйте их при необходимост�� - "***
310
+ * `user` - запрос пользователя передается через эту роль.
311
+ * `function-call` - тело вызова функции передается через эту роль.
312
+ Хотя модель обучена генерировать вызов функции в виде ***"Вызов функции: {...}\<end_of_turn\>"***, вы все равно должны передать только тело ***"{...}"***
313
+ в поле *"content"*, поскольку используя `apply_chat_template`, постскриптум в инструкциях добавляется автоматически.
314
+ * `function-response` - в этой роли мы должны передать ответ нашей функции в поле *"content"* в виде словаря ***'{"name_returnable_value": value}'***.
315
+ * `model` - содержимое, относящееся к этой роли, считается сгенерированным текстом модели.
316
+
317
+
318
+ ### Chat history with *Function Calling*
319
+
320
+ ```
321
+ [
322
+ {"role": "system", "content": "Ты - полезный помощник, имеющий доступ к следующим функциям. Используйте их при необходимости - "},
323
+ {"role": "user", "content": "Привет, не мог бы ты сказать мне, во сколько в Краснодаре восходит солнце?"},
324
+ {"role": "function-call", "content": '{"name": "get_sunrise_sunset_times", "arguments": {"city": "Краснодар"}}'},
325
+ {"role": "function-response", "content": '{"times_list": ["6:00", "18:00"]}'}
326
+ ]
327
+ ```
328
+
329
+ Это выглядит как:
330
+ ```
331
+ <bos><start_of_turn>user
332
+ Ты - полезный помощник, имеющий доступ к следующим функциям. Используйте их при необходимости - {
333
+ "name": "get_weather",
334
+ "description": "Функция, которая возвращает погоду в заданном городе.",
335
+ "parameters": {
336
+ "type": "object",
337
+ "properties": {
338
+ "city": {
339
+ "type": "string",
340
+ "description": "Город, для которого надо узнать погоду."
341
+ }
342
+ },
343
+ "required": [
344
+ "city"
345
+ ]
346
+ }
347
+ },
348
+ {
349
+ "name": "get_sunrise_sunset_times",
350
+ "description": "Функция, которая возвращает время восхода и заката для заданного города для текущей даты (дата от пользователя не требуется), в формате списка: [sunrise_time, sunset_time].",
351
+ "parameters": {
352
+ "type": "object",
353
+ "properties": {
354
+ "city": {
355
+ "type": "string",
356
+ "description": "Город, в котором можно узнать время восхода и захода солнца."
357
+ }
358
+ },
359
+ "required": [
360
+ "city"
361
+ ]
362
+ }
363
+ }
364
+
365
+ Привет, не мог бы ты сказать мне, во сколько в Краснодаре восходит солнце?<end_of_turn>
366
+ <start_of_turn>model
367
+ Вызов функции: {"name": "get_sunrise_sunset_times", "arguments": {"city": "Краснодар"}}<end_of_turn>
368
+ <start_of_turn>user
369
+ Ответ от функции: {"times_list": ["6:00", "18:00"]}<end_of_turn>
370
+ ```
371
+
372
+
373
+ ### Chat history with a standard user-model template
374
+
375
+ ```
376
+ [
377
+ {"role": "system", "content": "Ты добрый помощник"},
378
+ {"role": "user", "content": "Расскажи мне о Москве"}
379
+ ]
380
+ ```
381
+
382
+ Это выглядит как:
383
+ ```
384
+ <bos><start_of_turn>user
385
+ Ты добрый помощник
386
+
387
+ Расскажи мне о Москве<end_of_turn>
388
+ ```
389
+
390
+ ## <a name="eval"></a>Evaluation
391
+
392
+ В процессе обучения ошибка валидации была приближена к следующим значениям:
393
+
394
+ | **Model** | **Generation Language** | **Approximately Validation Loss** |
395
+ | :-----: | :-----: | :-----: |
396
+ | [DiTy/gemma-2-9b-it-russian-function-calling-GGUF](https://huggingface.co/DiTy/gemma-2-9b-it-russian-function-calling-GGUF) | RU | 0.57
397
+ | [DiTy/gemma-2-9b-it-function-calling-GGUF](https://huggingface.co/DiTy/gemma-2-9b-it-function-calling-GGUF) | EN | 0.5 |
398
+ | [DiTy/gemma-2-2b-it-function-calling](https://huggingface.co/DiTy/gemma-2-2b-it-function-calling) | EN | 0.66 |
399
+
400
+ ## Citation
401
+
402
+ ```none
403
+ @article{gemma_2024,
404
+ title={Gemma},
405
+ url={https://www.kaggle.com/m/3301},
406
+ DOI={10.34740/KAGGLE/M/3301},
407
+ publisher={Kaggle},
408
+ author={Gemma Team},
409
+ year={2024}
410
+ }
411
+ ```