Update README.md
Browse files
README.md
CHANGED
|
@@ -53,33 +53,7 @@ tools = [
|
|
| 53 |
"required": ["location", "format"],
|
| 54 |
},
|
| 55 |
}
|
| 56 |
-
}
|
| 57 |
-
{
|
| 58 |
-
"type": "function",
|
| 59 |
-
"function": {
|
| 60 |
-
"name": "get_n_day_weather_forecast",
|
| 61 |
-
"description": "Get an N-day weather forecast",
|
| 62 |
-
"parameters": {
|
| 63 |
-
"type": "object",
|
| 64 |
-
"properties": {
|
| 65 |
-
"location": {
|
| 66 |
-
"type": "string",
|
| 67 |
-
"description": "The city and state, e.g. San Francisco, CA",
|
| 68 |
-
},
|
| 69 |
-
"format": {
|
| 70 |
-
"type": "string",
|
| 71 |
-
"enum": ["celsius", "fahrenheit"],
|
| 72 |
-
"description": "The temperature unit to use. Infer this from the user's location.",
|
| 73 |
-
},
|
| 74 |
-
"num_days": {
|
| 75 |
-
"type": "integer",
|
| 76 |
-
"description": "The number of days to forecast",
|
| 77 |
-
}
|
| 78 |
-
},
|
| 79 |
-
"required": ["location", "format", "num_days"]
|
| 80 |
-
},
|
| 81 |
-
}
|
| 82 |
-
},
|
| 83 |
]
|
| 84 |
```
|
| 85 |
|
|
@@ -107,10 +81,9 @@ messages = [
|
|
| 107 |
},
|
| 108 |
{
|
| 109 |
"role": "user",
|
| 110 |
-
"content": "What is the current weather in San Francisco?
|
| 111 |
},
|
| 112 |
]
|
| 113 |
-
|
| 114 |
```
|
| 115 |
|
| 116 |
### Preparing Model Inputs
|
|
@@ -122,14 +95,15 @@ model_inputs = inputs.to(device)
|
|
| 122 |
### Generating the Response
|
| 123 |
```python
|
| 124 |
model.to(device)
|
| 125 |
-
|
| 126 |
generate_ids = model.generate(model_inputs, streamer=streamer, do_sample=True, max_length=4096)
|
| 127 |
decoded = tokenizer.batch_decode(generate_ids)
|
| 128 |
```
|
| 129 |
|
| 130 |
### Output
|
| 131 |
```python
|
| 132 |
-
|
|
|
|
|
|
|
| 133 |
```
|
| 134 |
|
| 135 |
|
|
|
|
| 53 |
"required": ["location", "format"],
|
| 54 |
},
|
| 55 |
}
|
| 56 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
]
|
| 58 |
```
|
| 59 |
|
|
|
|
| 81 |
},
|
| 82 |
{
|
| 83 |
"role": "user",
|
| 84 |
+
"content": "What is the current weather in San Francisco?"
|
| 85 |
},
|
| 86 |
]
|
|
|
|
| 87 |
```
|
| 88 |
|
| 89 |
### Preparing Model Inputs
|
|
|
|
| 95 |
### Generating the Response
|
| 96 |
```python
|
| 97 |
model.to(device)
|
|
|
|
| 98 |
generate_ids = model.generate(model_inputs, streamer=streamer, do_sample=True, max_length=4096)
|
| 99 |
decoded = tokenizer.batch_decode(generate_ids)
|
| 100 |
```
|
| 101 |
|
| 102 |
### Output
|
| 103 |
```python
|
| 104 |
+
<tool_call>
|
| 105 |
+
{"arguments": {"location": "San Francisco, CA", "format": "celsius"}, "name": "get_current_weather"}
|
| 106 |
+
</tool_call>
|
| 107 |
```
|
| 108 |
|
| 109 |
|