alexrs commited on
Commit
2ec088d
·
verified ·
1 Parent(s): 9bbf847

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -2
README.md CHANGED
@@ -202,7 +202,8 @@ Command A+ has been specifically trained with conversational tool use capabiliti
202
 
203
  Tool use with Command A+ is supported through [chat templates](https://huggingface.co/docs/transformers/main/en/chat_templating#advanced-tool-use--function-calling) in Transformers. We recommend providing tool descriptions using JSON schema.
204
 
205
- **Tool Use Example**
 
206
 
207
  ```py
208
  from transformers import AutoTokenizer
@@ -266,8 +267,10 @@ conversation.append({"role": "tool", "tool_call_id": "0", "content": api_respons
266
  After that, you can generate() again to let the model use the tool result in the chat.
267
 
268
  Note that this was a very brief introduction to tool calling \- for more information, see the Transformers [tool use documentation](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling).
 
269
 
270
- **Tool Use with citations**
 
271
 
272
  Optionally, one can ask the model to include grounding spans (citations) in its response to indicate the source of the information, by using `enable_citations=True` in `tokenizer.apply_chat_template(*)`. The generation would look like this:
273
 
@@ -276,6 +279,8 @@ On 29th September 2023, the total sales amount was <co>10000</co: 0:[0]> and the
276
  ```
277
 
278
  When citations are turned on, the model associates pieces of texts (called "spans") with those specific tool results that support them (called "sources"). Command A+ uses a pair of tags `<co>` and `</co>` to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. For example, `<co>span</co: 0:[1,2],1:[0]>` means that "span" is supported by result 1 and 2 from `tool_call_id=0` as well as result 0 from `tool_call_id=1`. Sources from the same tool call are grouped together and listed as `{tool_call_id}:[{list of result indices}]`, before they are joined together by ",".
 
 
279
 
280
  ## **Model Card Contact**
281
 
 
202
 
203
  Tool use with Command A+ is supported through [chat templates](https://huggingface.co/docs/transformers/main/en/chat_templating#advanced-tool-use--function-calling) in Transformers. We recommend providing tool descriptions using JSON schema.
204
 
205
+ <details>
206
+ <summary><b>Tool Use Example [CLICK TO EXPAND]</b></summary>
207
 
208
  ```py
209
  from transformers import AutoTokenizer
 
267
  After that, you can generate() again to let the model use the tool result in the chat.
268
 
269
  Note that this was a very brief introduction to tool calling \- for more information, see the Transformers [tool use documentation](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling).
270
+ </details>
271
 
272
+ <details>
273
+ <summary><b>Tool Use With Citations [CLICK TO EXPAND]</b></summary>
274
 
275
  Optionally, one can ask the model to include grounding spans (citations) in its response to indicate the source of the information, by using `enable_citations=True` in `tokenizer.apply_chat_template(*)`. The generation would look like this:
276
 
 
279
  ```
280
 
281
  When citations are turned on, the model associates pieces of texts (called "spans") with those specific tool results that support them (called "sources"). Command A+ uses a pair of tags `<co>` and `</co>` to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. For example, `<co>span</co: 0:[1,2],1:[0]>` means that "span" is supported by result 1 and 2 from `tool_call_id=0` as well as result 0 from `tool_call_id=1`. Sources from the same tool call are grouped together and listed as `{tool_call_id}:[{list of result indices}]`, before they are joined together by ",".
282
+ </details>
283
+
284
 
285
  ## **Model Card Contact**
286