Update README.md
Browse files
README.md
CHANGED
@@ -3,13 +3,64 @@ library_name: transformers
|
|
3 |
tags: []
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
|
|
|
|
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
|
11 |
|
12 |
-
## Model Details
|
13 |
|
14 |
### Model Description
|
15 |
|
|
|
3 |
tags: []
|
4 |
---
|
5 |
|
6 |
+
# DiTy/gemma-2-9b-it-function-calling
|
7 |
|
8 |
+
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,
|
9 |
+
fully annotated by humans only, on the English version of the <ins>*DiTy/function-calling*</ins> dataset.
|
10 |
<!-- Provide a quick summary of what the model is/does. -->
|
11 |
+
--
|
12 |
+
---
|
13 |
+
## Model card tree
|
14 |
+
|
15 |
+
* [How prepare your functions (tools) for *Function Calling*](#prepare_func_call)
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
## Usage (HuggingFace Transformers)
|
22 |
+
|
23 |
+
Below we share some code snippets on how to get quickly started with running the model. First, install the Transformers library with:
|
24 |
+
```bash
|
25 |
+
pip install -U transformers
|
26 |
+
```
|
27 |
+
|
28 |
+
### <a name="prepare_func_call"></a>Prepare your functions for *Function Calling*
|
29 |
+
|
30 |
+
You should write the functions (tools) used by the model in *Python code* and make sure to add *Python docstrings* as in the example below:
|
31 |
+
```python
|
32 |
+
def get_weather(city: str):
|
33 |
+
"""
|
34 |
+
A function that returns the weather in a given city.
|
35 |
+
|
36 |
+
Args:
|
37 |
+
city: The city to get the weather for.
|
38 |
+
"""
|
39 |
+
import random
|
40 |
+
|
41 |
+
return "sunny" if random.random() > 0.5 else "rainy"
|
42 |
+
|
43 |
+
|
44 |
+
def get_sunrise_sunset_times(city: str):
|
45 |
+
"""
|
46 |
+
A function that returns the time of sunrise and sunset at the present moment, for a given city, in the form of a list: [sunrise_time, sunset_time].
|
47 |
+
|
48 |
+
Args:
|
49 |
+
city: The city to get the sunrise and sunset times for.
|
50 |
+
"""
|
51 |
+
|
52 |
+
return ["6:00 AM", "6:00 PM"]
|
53 |
+
```
|
54 |
+
|
55 |
+
### Using transformers
|
56 |
+
|
57 |
+
```python
|
58 |
+
|
59 |
+
```
|
60 |
+
|
61 |
|
62 |
|
63 |
|
|
|
64 |
|
65 |
### Model Description
|
66 |
|