jncraton commited on
Commit
24882f1
1 Parent(s): 88b99c5

Upload folder using huggingface_hub

Browse files
Files changed (7) hide show
  1. README.md +294 -0
  2. config.json +7 -0
  3. model.bin +3 -0
  4. special_tokens_map.json +32 -0
  5. tokenizer.json +0 -0
  6. tokenizer_config.json +198 -0
  7. vocabulary.json +0 -0
README.md ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ datasets:
4
+ - Salesforce/xlam-function-calling-60k
5
+ language:
6
+ - en
7
+ pipeline_tag: text-generation
8
+ tags:
9
+ - function-calling
10
+ - LLM Agent
11
+ - tool-use
12
+ - deepseek
13
+ - pytorch
14
+ ---
15
+
16
+ <p align="center">
17
+ <img width="300px" alt="xLAM" src="https://huggingface.co/Salesforce/xLAM-v0.1-r/resolve/main/xlam-no-background.png">
18
+ </p>
19
+ <p align="center">
20
+ <a href="https://apigen-pipeline.github.io/">[Homepage]</a> |
21
+ <a href="https://arxiv.org/abs/2406.18518">[Paper]</a> |
22
+ <a href="https://huggingface.co/datasets/Salesforce/xlam-function-calling-60k">[Dataset]</a> |
23
+ <a href="https://github.com/SalesforceAIResearch/xLAM">[Github]</a>
24
+ </p>
25
+ <hr>
26
+
27
+ Welcome to the xLAM model family! [Large Action Models (LAMs)](https://blog.salesforceairesearch.com/large-action-models/) are advanced large language models designed to enhance decision-making and translate user intentions into executable actions that interact with the world. LAMs autonomously plan and execute tasks to achieve specific goals, serving as the brains of AI agents. They have the potential to automate workflow processes across various domains, making them invaluable for a wide range of applications.
28
+
29
+ ## Table of Contents
30
+ - [Model Series](#model-series)
31
+ - [Repository Overview](#repository-overview)
32
+ - [Benchmark Results](#benchmark-results)
33
+ - [Usage](#usage)
34
+ - [Basic Usage with Huggingface](#basic-usage-with-huggingface)
35
+ - [Usage with vLLM](#usage-with-vllm)
36
+ - [License](#license)
37
+ - [Citation](#citation)
38
+
39
+ ## Model Series
40
+
41
+ We provide a series of xLAMs in different sizes to cater to various applications, including those optimized for function-calling and general agent applications:
42
+
43
+ | Model | # Total Params | Context Length | Download Model | Download GGUF files |
44
+ |------------------------|----------------|----------------|----------------|----------|
45
+ | xLAM-1b-fc-r | 1.35B | 16384 | [🤗 Link](https://huggingface.co/Salesforce/xLAM-1b-fc-r) | [🤗 Link](https://huggingface.co/Salesforce/xLAM-1b-fc-r-gguf) |
46
+ | xLAM-7b-fc-r | 6.91B | 4096 | [🤗 Link](https://huggingface.co/Salesforce/xLAM-7b-fc-r) | [🤗 Link](https://huggingface.co/Salesforce/xLAM-7b-fc-r-gguf) | |
47
+
48
+ The `fc` series of models are optimized for function-calling capability, providing fast, accurate, and structured responses based on input queries and available APIs. These models are fine-tuned based on the [deepseek-coder](https://huggingface.co/collections/deepseek-ai/deepseek-coder-65f295d7d8a0a29fe39b4ec4) models and are designed to be small enough for deployment on personal devices like phones or computers.
49
+
50
+ We also provide their quantized [GGUF](https://huggingface.co/docs/hub/en/gguf) files for efficient deployment and execution. GGUF is a file format designed to efficiently store and load large language models, making GGUF ideal for running AI models on local devices with limited resources, enabling offline functionality and enhanced privacy.
51
+
52
+ For more details, check our [GitHub](https://github.com/SalesforceAIResearch/xLAM) and [paper](https://arxiv.org/abs/2406.18518).
53
+
54
+ ## Repository Overview
55
+
56
+ This repository is focused on our tiny `xLAM-1b-fc-r` model, which is optimized for function-calling and can be easily deployed on personal devices.
57
+
58
+ <div align="center">
59
+ <img src="https://github.com/apigen-pipeline/apigen-pipeline.github.io/blob/main/img/function-call-overview.png?raw=true"
60
+ alt="drawing" width="620"/>
61
+ </div>
62
+
63
+ Function-calling, or tool use, is one of the key capabilities for AI agents. It requires the model not only understand and generate human-like text but also to execute functional API calls based on natural language instructions. This extends the utility of LLMs beyond simple conversation tasks to dynamic interactions with a variety of digital services and applications, such as retrieving weather information, managing social media platforms, and handling financial services.
64
+
65
+ The instructions will guide you through the setup, usage, and integration of `xLAM-1b-fc-r` with HuggingFace and vLLM.
66
+ We will first introduce the basic usage, and then walk through the provided tutorial and example scripts in the [examples](https://huggingface.co/Salesforce/xLAM-1b-fc-r/tree/main/examples) folder.
67
+
68
+ ### Framework Versions
69
+
70
+ - Transformers 4.41.0
71
+ - Pytorch 2.3.0+cu121
72
+ - Datasets 2.19.1
73
+ - Tokenizers 0.19.1
74
+
75
+ ## Benchmark Results
76
+
77
+ We mainly test our function-calling models on the [Berkeley Function-Calling Leaderboard (BFCL)](https://gorilla.cs.berkeley.edu/leaderboard.html), which offers a comprehensive evaluation framework for assessing LLMs' function-calling capabilities across various programming languages and application domains like Java, JavaScript, and Python.
78
+
79
+
80
+ <div align="center">
81
+ <img src="https://github.com/apigen-pipeline/apigen-pipeline.github.io/blob/main/img/table-result-0718.png?raw=true" width="620" alt="Performance comparison on Berkeley Function-Calling Leaderboard">
82
+ <p>Performance comparison on the BFCL benchmark as of date 07/18/2024. Evaluated with <code>temperature=0.001</code> and <code>top_p=1</code></p>
83
+ </div>
84
+
85
+ <p>Our <code>xLAM-7b-fc-r</code> secures the 3rd place with an overall accuracy of 88.24% on the leaderboard, outperforming many strong models. Notably, our <code>xLAM-1b-fc-r</code> model is the only tiny model with less than 2B parameters on the leaderboard, but still achieves a competitive overall accuracy of 78.94% and outperforming GPT3-Turbo and many larger models.
86
+ Both models exhibit balanced performance across various categories, showing their strong function-calling capabilities despite their small sizes.</p>
87
+
88
+ See our [paper](https://arxiv.org/abs/2406.18518) and Github [repo](https://github.com/SalesforceAIResearch/xLAM) for more detailed analysis.
89
+
90
+
91
+ ## Usage
92
+
93
+ ### Basic Usage with Huggingface
94
+
95
+ To use the `xLAM-1b-fc-r` model from Huggingface, please first install the `transformers` library:
96
+ ```bash
97
+ pip install transformers>=4.41.0
98
+ ```
99
+
100
+ We use the following example to illustrate how to use our model to perform function-calling tasks.
101
+ Please note that, our model works best with our provided prompt format.
102
+ It allows us to extract JSON output that is similar to the [function-calling mode of ChatGPT](https://platform.openai.com/docs/guides/function-calling).
103
+
104
+ ````python
105
+ import json
106
+ import torch
107
+ from transformers import AutoModelForCausalLM, AutoTokenizer
108
+
109
+ torch.random.manual_seed(0)
110
+
111
+ model_name = "Salesforce/xLAM-1b-fc-r"
112
+ model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype="auto", trust_remote_code=True)
113
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
114
+
115
+ # Please use our provided instruction prompt for best performance
116
+ task_instruction = """
117
+ You are an expert in composing functions. You are given a question and a set of possible functions.
118
+ Based on the question, you will need to make one or more function/tool calls to achieve the purpose.
119
+ If none of the functions can be used, point it out and refuse to answer.
120
+ If the given question lacks the parameters required by the function, also point it out.
121
+ """.strip()
122
+
123
+ format_instruction = """
124
+ The output MUST strictly adhere to the following JSON format, and NO other text MUST be included.
125
+ The example format is as follows. Please make sure the parameter type is correct. If no function call is needed, please make tool_calls an empty list '[]'.
126
+ ```
127
+ {
128
+ "tool_calls": [
129
+ {"name": "func_name1", "arguments": {"argument1": "value1", "argument2": "value2"}},
130
+ ... (more tool calls as required)
131
+ ]
132
+ }
133
+ ```
134
+ """.strip()
135
+
136
+ # Define the input query and available tools
137
+ query = "What's the weather like in New York in fahrenheit?"
138
+
139
+ get_weather_api = {
140
+ "name": "get_weather",
141
+ "description": "Get the current weather for a location",
142
+ "parameters": {
143
+ "type": "object",
144
+ "properties": {
145
+ "location": {
146
+ "type": "string",
147
+ "description": "The city and state, e.g. San Francisco, New York"
148
+ },
149
+ "unit": {
150
+ "type": "string",
151
+ "enum": ["celsius", "fahrenheit"],
152
+ "description": "The unit of temperature to return"
153
+ }
154
+ },
155
+ "required": ["location"]
156
+ }
157
+ }
158
+
159
+ search_api = {
160
+ "name": "search",
161
+ "description": "Search for information on the internet",
162
+ "parameters": {
163
+ "type": "object",
164
+ "properties": {
165
+ "query": {
166
+ "type": "string",
167
+ "description": "The search query, e.g. 'latest news on AI'"
168
+ }
169
+ },
170
+ "required": ["query"]
171
+ }
172
+ }
173
+
174
+ openai_format_tools = [get_weather_api, search_api]
175
+
176
+ # Helper function to convert openai format tools to our more concise xLAM format
177
+ def convert_to_xlam_tool(tools):
178
+ ''''''
179
+ if isinstance(tools, dict):
180
+ return {
181
+ "name": tools["name"],
182
+ "description": tools["description"],
183
+ "parameters": {k: v for k, v in tools["parameters"].get("properties", {}).items()}
184
+ }
185
+ elif isinstance(tools, list):
186
+ return [convert_to_xlam_tool(tool) for tool in tools]
187
+ else:
188
+ return tools
189
+
190
+ # Helper function to build the input prompt for our model
191
+ def build_prompt(task_instruction: str, format_instruction: str, tools: list, query: str):
192
+ prompt = f"[BEGIN OF TASK INSTRUCTION]\n{task_instruction}\n[END OF TASK INSTRUCTION]\n\n"
193
+ prompt += f"[BEGIN OF AVAILABLE TOOLS]\n{json.dumps(xlam_format_tools)}\n[END OF AVAILABLE TOOLS]\n\n"
194
+ prompt += f"[BEGIN OF FORMAT INSTRUCTION]\n{format_instruction}\n[END OF FORMAT INSTRUCTION]\n\n"
195
+ prompt += f"[BEGIN OF QUERY]\n{query}\n[END OF QUERY]\n\n"
196
+ return prompt
197
+
198
+ # Build the input and start the inference
199
+ xlam_format_tools = convert_to_xlam_tool(openai_format_tools)
200
+ content = build_prompt(task_instruction, format_instruction, xlam_format_tools, query)
201
+
202
+ messages=[
203
+ { 'role': 'user', 'content': content}
204
+ ]
205
+ inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
206
+
207
+ # tokenizer.eos_token_id is the id of <|EOT|> token
208
+ outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
209
+ print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
210
+ ````
211
+
212
+ Then you should be able to see the following output string in JSON format:
213
+
214
+ ```shell
215
+ {"tool_calls": [{"name": "get_weather", "arguments": {"location": "New York", "unit": "fahrenheit"}}]}
216
+ ```
217
+
218
+ We highly recommend to use our provided prompt format and helper functions to yield the best function-calling performance of our model.
219
+
220
+ ### Usage with vLLM
221
+
222
+ We provide example scripts to deploy our model with `vllm` and run inferences. First, install the required packages:
223
+
224
+ ```bash
225
+ pip install vllm openai argparse jinja2
226
+ ```
227
+
228
+ The example scripts are located in the [examples](https://huggingface.co/Salesforce/xLAM-1b-fc-r/tree/main/examples) folder.
229
+
230
+ #### 1. Test Prompt Template
231
+
232
+ To build prompts using the chat template and output formatted prompts ready for various test cases, run:
233
+
234
+ ```bash
235
+ python test_prompt_template.py --model
236
+ ```
237
+
238
+ #### 2. Test xLAM Model with a Manually Served Endpoint
239
+
240
+ a. Serve the model with vLLM:
241
+
242
+ ```bash
243
+ python -m vllm.entrypoints.openai.api_server --model Salesforce/xLAM-1b-fc-r --served-model-name xlam-1b-fc-r --dtype bfloat16 --port 8001
244
+ ```
245
+
246
+ b. Run the test script:
247
+
248
+ ```bash
249
+ python test_xlam_model_with_endpoint.py --model_name xlam-1b-fc-r --port 8001 [OPTIONS]
250
+ ```
251
+
252
+ Options:
253
+ - `--temperature`: Default 0.3
254
+ - `--top_p`: Default 1.0
255
+ - `--max_tokens`: Default 512
256
+
257
+ This test script provides a handler implementation that can be easily applied to your customized function-calling applications.
258
+
259
+ #### 3. Test xLAM Model by Directly Using vLLM Library
260
+
261
+ To test the xLAM model directly with the vLLM library, run:
262
+
263
+ ```bash
264
+ python test_xlam_model_with_vllm.py --model Salesforce/xLAM-1b-fc-r [OPTIONS]
265
+ ```
266
+
267
+ Options are the same as for the endpoint test. This test script also provides a handler implementation that can be easily applied to your customized function-calling applications.
268
+
269
+ #### Customization
270
+
271
+ These examples are designed to be flexible and easily integrated into your own projects. Feel free to modify the scripts to suit your specific needs and applications. You can adjust test queries or API definitions in each script to test different scenarios or model capabilities.
272
+
273
+ Additional customization tips:
274
+ - Modify the `--dtype` parameter when serving the model based on your GPU capacity.
275
+ - Refer to the vLLM documentation for more detailed configuration options.
276
+ - Explore the `demo.ipynb` file for a comprehensive description of the entire workflow, including how to execute APIs.
277
+
278
+ These resources provide a robust foundation for integrating xLAM models into your applications, allowing for tailored and efficient deployment.
279
+
280
+ ## License
281
+
282
+ `xLAM-1b-fc-r` is distributed under the CC-BY-NC-4.0 license, with additional terms specified in the [Deepseek license](https://github.com/deepseek-ai/DeepSeek-LLM/blob/main/LICENSE-MODEL).
283
+
284
+ ## Citation
285
+
286
+ If you find this repo helpful, please cite our paper:
287
+ ```bibtex
288
+ @article{liu2024apigen,
289
+ title={APIGen: Automated Pipeline for Generating Verifiable and Diverse Function-Calling Datasets},
290
+ author={Liu, Zuxin and Hoang, Thai and Zhang, Jianguo and Zhu, Ming and Lan, Tian and Kokane, Shirley and Tan, Juntao and Yao, Weiran and Liu, Zhiwei and Feng, Yihao and others},
291
+ journal={arXiv preprint arXiv:2406.18518},
292
+ year={2024}
293
+ }
294
+ ```
config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<\uff5cbegin\u2581of\u2581sentence\uff5c>",
3
+ "eos_token": "<|EOT|>",
4
+ "layer_norm_epsilon": 1e-06,
5
+ "multi_query_attention": true,
6
+ "unk_token": ""
7
+ }
model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c6d0aec302e214a04e5ddbf009ca03e6afb738d8ab41d256e0eabcf3cc61274
3
+ size 1348894684
special_tokens_map.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ {
4
+ "content": "<|EOT|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ }
10
+ ],
11
+ "bos_token": {
12
+ "content": "<|begin▁of▁sentence|>",
13
+ "lstrip": false,
14
+ "normalized": true,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "eos_token": {
19
+ "content": "<|EOT|>",
20
+ "lstrip": false,
21
+ "normalized": true,
22
+ "rstrip": false,
23
+ "single_word": false
24
+ },
25
+ "pad_token": {
26
+ "content": "<|end▁of▁sentence|>",
27
+ "lstrip": false,
28
+ "normalized": true,
29
+ "rstrip": false,
30
+ "single_word": false
31
+ }
32
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "32000": {
6
+ "content": "õ",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": false
12
+ },
13
+ "32001": {
14
+ "content": "÷",
15
+ "lstrip": false,
16
+ "normalized": true,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": false
20
+ },
21
+ "32002": {
22
+ "content": "Á",
23
+ "lstrip": false,
24
+ "normalized": true,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": false
28
+ },
29
+ "32003": {
30
+ "content": "ý",
31
+ "lstrip": false,
32
+ "normalized": true,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": false
36
+ },
37
+ "32004": {
38
+ "content": "À",
39
+ "lstrip": false,
40
+ "normalized": true,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": false
44
+ },
45
+ "32005": {
46
+ "content": "ÿ",
47
+ "lstrip": false,
48
+ "normalized": true,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": false
52
+ },
53
+ "32006": {
54
+ "content": "ø",
55
+ "lstrip": false,
56
+ "normalized": true,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": false
60
+ },
61
+ "32007": {
62
+ "content": "ú",
63
+ "lstrip": false,
64
+ "normalized": true,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": false
68
+ },
69
+ "32008": {
70
+ "content": "þ",
71
+ "lstrip": false,
72
+ "normalized": true,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": false
76
+ },
77
+ "32009": {
78
+ "content": "ü",
79
+ "lstrip": false,
80
+ "normalized": true,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": false
84
+ },
85
+ "32010": {
86
+ "content": "ù",
87
+ "lstrip": false,
88
+ "normalized": true,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": false
92
+ },
93
+ "32011": {
94
+ "content": "ö",
95
+ "lstrip": false,
96
+ "normalized": true,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": false
100
+ },
101
+ "32012": {
102
+ "content": "û",
103
+ "lstrip": false,
104
+ "normalized": true,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": false
108
+ },
109
+ "32013": {
110
+ "content": "<|begin▁of▁sentence|>",
111
+ "lstrip": false,
112
+ "normalized": true,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "32014": {
118
+ "content": "<|end▁of▁sentence|>",
119
+ "lstrip": false,
120
+ "normalized": true,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": true
124
+ },
125
+ "32015": {
126
+ "content": "<|fim▁hole|>",
127
+ "lstrip": false,
128
+ "normalized": true,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "32016": {
134
+ "content": "<|fim▁begin|>",
135
+ "lstrip": false,
136
+ "normalized": true,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "32017": {
142
+ "content": "<|fim▁end|>",
143
+ "lstrip": false,
144
+ "normalized": true,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "32018": {
150
+ "content": "<pad>",
151
+ "lstrip": false,
152
+ "normalized": true,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "32019": {
158
+ "content": "<|User|>",
159
+ "lstrip": false,
160
+ "normalized": true,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "32020": {
166
+ "content": "<|Assistant|>",
167
+ "lstrip": false,
168
+ "normalized": true,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "32021": {
174
+ "content": "<|EOT|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": true
180
+ }
181
+ },
182
+ "additional_special_tokens": [
183
+ "<|EOT|>"
184
+ ],
185
+ "bos_token": "<|begin▁of▁sentence|>",
186
+ "chat_template": "{% set system_message = 'You are an AI assistant for function calling.For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer\\n' %}{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{% endif %}{% if system_message is defined %}{{ system_message }}{% endif %}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '### Instruction:\\n' + content + '\\n### Response:' }}{% elif message['role'] == 'assistant' %}{{ '\\n' + content + '\\n<|EOT|>\\n' }}{% endif %}{% endfor %}",
187
+ "clean_up_tokenization_spaces": false,
188
+ "eos_token": "<|EOT|>",
189
+ "legacy": true,
190
+ "model_max_length": 16384,
191
+ "pad_token": "<|end▁of▁sentence|>",
192
+ "padding_side": "right",
193
+ "sp_model_kwargs": {},
194
+ "split_special_tokens": false,
195
+ "tokenizer_class": "LlamaTokenizer",
196
+ "unk_token": null,
197
+ "use_default_system_prompt": false
198
+ }
vocabulary.json ADDED
The diff for this file is too large to render. See raw diff