Update README.md
Browse files
README.md
CHANGED
@@ -94,6 +94,8 @@ inputs = tokenizer.apply_chat_template(
|
|
94 |
add_generation_prompt=True, # adding prompt for generation
|
95 |
tools=[get_weather, get_sunrise_sunset_times], # our functions (tools)
|
96 |
)
|
|
|
|
|
97 |
```
|
98 |
|
99 |
Then our `inputs` will look like this:
|
@@ -152,7 +154,9 @@ generated_ids = model.generate(
|
|
152 |
eos_token_id=terminator_ids,
|
153 |
bos_token_id=tokenizer.bos_token_id,
|
154 |
)
|
155 |
-
generated_response = tokenizer.decode(generated_ids[0][prompt_ids.shape[-1]:], skip_special_tokens=False) # `skip_special_tokens=False` for debug
|
|
|
|
|
156 |
```
|
157 |
|
158 |
We get the generation as a function call:
|
@@ -175,6 +179,8 @@ inputs = tokenizer.apply_chat_template(
|
|
175 |
add_generation_prompt=True, # adding prompt for generation
|
176 |
tools=[get_weather, get_sunrise_sunset_times], # our functions (tools)
|
177 |
)
|
|
|
|
|
178 |
```
|
179 |
|
180 |
Let's make sure the `inputs` are correct:
|
@@ -232,6 +238,8 @@ generated_ids = model.generate(
|
|
232 |
bos_token_id=tokenizer.bos_token_id,
|
233 |
)
|
234 |
generated_response = tokenizer.decode(generated_ids[0][prompt_ids.shape[-1]:], skip_special_tokens=False) # `skip_special_tokens=False` for debug
|
|
|
|
|
235 |
```
|
236 |
|
237 |
As a result, we get the model's response:
|
|
|
94 |
add_generation_prompt=True, # adding prompt for generation
|
95 |
tools=[get_weather, get_sunrise_sunset_times], # our functions (tools)
|
96 |
)
|
97 |
+
|
98 |
+
print(inputs)
|
99 |
```
|
100 |
|
101 |
Then our `inputs` will look like this:
|
|
|
154 |
eos_token_id=terminator_ids,
|
155 |
bos_token_id=tokenizer.bos_token_id,
|
156 |
)
|
157 |
+
generated_response = tokenizer.decode(generated_ids[0][prompt_ids.shape[-1]:], skip_special_tokens=False) # `skip_special_tokens=False` for debug
|
158 |
+
|
159 |
+
print(generated_response)
|
160 |
```
|
161 |
|
162 |
We get the generation as a function call:
|
|
|
179 |
add_generation_prompt=True, # adding prompt for generation
|
180 |
tools=[get_weather, get_sunrise_sunset_times], # our functions (tools)
|
181 |
)
|
182 |
+
|
183 |
+
print(inputs)
|
184 |
```
|
185 |
|
186 |
Let's make sure the `inputs` are correct:
|
|
|
238 |
bos_token_id=tokenizer.bos_token_id,
|
239 |
)
|
240 |
generated_response = tokenizer.decode(generated_ids[0][prompt_ids.shape[-1]:], skip_special_tokens=False) # `skip_special_tokens=False` for debug
|
241 |
+
|
242 |
+
print(generated_response)
|
243 |
```
|
244 |
|
245 |
As a result, we get the model's response:
|