Update README.md
Browse files
README.md
CHANGED
@@ -1,21 +1,52 @@
|
|
1 |
---
|
2 |
-
license: cc-by-4.0
|
3 |
---
|
|
|
4 |
<p align="center">
|
5 |
<img width="300px" alt="xLAM" src="https://huggingface.co/Salesforce/xLAM-v0.1-r/resolve/main/xlam-no-background.png">
|
6 |
</p>
|
7 |
-
<p align="center"
|
|
|
|
|
|
|
|
|
|
|
8 |
<hr>
|
9 |
|
|
|
|
|
10 |
## Model Summary
|
11 |
|
12 |
-
This repo provides the GGUF format for the xLAM-
|
13 |
This model is designed for function composition and tool utilization tasks, providing fast, accurate, and structured responses based on the input queries and available tools.
|
14 |
We use [llama.cpp](https://github.com/ggerganov/llama.cpp) framework to convert models to GGUF. GGUF model files offer significant advantages in terms of interoperability, efficiency, scalability, flexibility, and ease of use. They are particularly valuable in applications requiring efficient model deployment, sharing, and optimization across diverse platforms and hardware environments.
|
15 |
|
16 |
-
## Model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
The `xLAM-1B-FC-r` model is a fine-tuned version of [deepseek-ai/deepseek-coder-1.3b-instruct](https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-instruct), optimized for tasks that require composing functions and utilizing tools to answer queries. For more details, check our [paper](https://arxiv.org/abs/2406.18518).
|
19 |
|
20 |
## How to download GGUF files
|
21 |
|
@@ -32,7 +63,7 @@ huggingface-cli login
|
|
32 |
|
33 |
3. **Download the GGUF model:**
|
34 |
```
|
35 |
-
huggingface-cli download
|
36 |
```
|
37 |
|
38 |
## Prompt template
|
@@ -58,7 +89,9 @@ You are an AI assistant for function calling.For politically sensitive questions
|
|
58 |
### Response:
|
59 |
|
60 |
```
|
61 |
-
|
|
|
|
|
62 |
## Usage
|
63 |
|
64 |
### Command Line
|
@@ -92,4 +125,35 @@ output = llm(
|
|
92 |
echo=True # Echo the prompt back in the output
|
93 |
) # Generate a completion, can also call create_completion
|
94 |
print(output)
|
95 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: cc-by-nc-4.0
|
3 |
---
|
4 |
+
|
5 |
<p align="center">
|
6 |
<img width="300px" alt="xLAM" src="https://huggingface.co/Salesforce/xLAM-v0.1-r/resolve/main/xlam-no-background.png">
|
7 |
</p>
|
8 |
+
<p align="center">
|
9 |
+
<a href="https://apigen-pipeline.github.io/">[Homepage]</a> |
|
10 |
+
<a href="https://arxiv.org/abs/2406.18518">[Paper]</a> |
|
11 |
+
<a href="https://huggingface.co/datasets/Salesforce/xlam-function-calling-60k">[Dataset]</a> |
|
12 |
+
<a href="https://github.com/SalesforceAIResearch/xLAM">[Github]</a>
|
13 |
+
</p>
|
14 |
<hr>
|
15 |
|
16 |
+
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.
|
17 |
+
|
18 |
## Model Summary
|
19 |
|
20 |
+
This repo provides the GGUF format for the xLAM-1b-fc-r model. Here's a link to original model [xLAM-1b-fc-r](https://huggingface.co/salesforce/xLAM-1b-fc-r)
|
21 |
This model is designed for function composition and tool utilization tasks, providing fast, accurate, and structured responses based on the input queries and available tools.
|
22 |
We use [llama.cpp](https://github.com/ggerganov/llama.cpp) framework to convert models to GGUF. GGUF model files offer significant advantages in terms of interoperability, efficiency, scalability, flexibility, and ease of use. They are particularly valuable in applications requiring efficient model deployment, sharing, and optimization across diverse platforms and hardware environments.
|
23 |
|
24 |
+
## Model Series
|
25 |
+
|
26 |
+
We provide a series of xLAMs in different sizes to cater to various applications, including those optimized for function-calling and general agent applications:
|
27 |
+
|
28 |
+
| Model | # Total Params | Context Length | Download Model | Download GGUF files |
|
29 |
+
|------------------------|----------------|----------------|----------------|----------|
|
30 |
+
| xLAM-1b-fc-r | 1.35B | 16k | [🤗 Link](https://huggingface.co/Salesforce/xLAM-1b-fc-r) | [🤗 Link](https://huggingface.co/Salesforce/xLAM-1b-fc-r-gguf) |
|
31 |
+
| xLAM-7b-fc-r | 6.91B | 4k | [🤗 Link](https://huggingface.co/Salesforce/xLAM-7b-fc-r) | [🤗 Link](https://huggingface.co/Salesforce/xLAM-7b-fc-r-gguf) |
|
32 |
+
|
33 |
+
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.
|
34 |
+
|
35 |
+
For more details, check our [paper](https://arxiv.org/abs/2406.18518).
|
36 |
+
|
37 |
+
## Repository Overview
|
38 |
+
|
39 |
+
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.
|
40 |
+
|
41 |
+
<div align="center">
|
42 |
+
<img src="https://github.com/apigen-pipeline/apigen-pipeline.github.io/blob/main/img/function-call-overview.png?raw=true"
|
43 |
+
alt="drawing" width="620"/>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
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.
|
47 |
+
|
48 |
+
The instructions will guide you through the setup, usage, and integration of `xLAM-1b-fc-r-gguf` with HuggingFace and llama-cpp.
|
49 |
|
|
|
50 |
|
51 |
## How to download GGUF files
|
52 |
|
|
|
63 |
|
64 |
3. **Download the GGUF model:**
|
65 |
```
|
66 |
+
huggingface-cli download https://huggingface.co/Salesforce/xLAM-1b-fc-r-gguf xLAM-1B-FC-r.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
|
67 |
```
|
68 |
|
69 |
## Prompt template
|
|
|
89 |
### Response:
|
90 |
|
91 |
```
|
92 |
+
We highly recommend using our provided `task_instruction`, `format_instruction`, and `tools` format to achieve the best performance.
|
93 |
+
For more information, refer to [prompt-documentation](https://huggingface.co/Salesforce/xLAM-1b-fc-r#basic-usage-with-huggingface).
|
94 |
+
|
95 |
## Usage
|
96 |
|
97 |
### Command Line
|
|
|
125 |
echo=True # Echo the prompt back in the output
|
126 |
) # Generate a completion, can also call create_completion
|
127 |
print(output)
|
128 |
+
```
|
129 |
+
|
130 |
+
## Benchmark Results
|
131 |
+
|
132 |
+
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.
|
133 |
+
|
134 |
+
|
135 |
+
<div align="center">
|
136 |
+
<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">
|
137 |
+
<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>
|
138 |
+
</div>
|
139 |
+
|
140 |
+
<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.
|
141 |
+
Both models exhibit balanced performance across various categories, showing their strong function-calling capabilities despite their small sizes.</p>
|
142 |
+
|
143 |
+
See our [paper](https://arxiv.org/abs/2406.18518) for more detailed analysis.
|
144 |
+
|
145 |
+
## License
|
146 |
+
|
147 |
+
`xLAM-1b-fc-r-gguf` 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).
|
148 |
+
|
149 |
+
## Citation
|
150 |
+
|
151 |
+
If you find this repo helpful, please cite our paper:
|
152 |
+
```bibtex
|
153 |
+
@article{liu2024apigen,
|
154 |
+
title={APIGen: Automated Pipeline for Generating Verifiable and Diverse Function-Calling Datasets},
|
155 |
+
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},
|
156 |
+
journal={arXiv preprint arXiv:2406.18518},
|
157 |
+
year={2024}
|
158 |
+
}
|
159 |
+
```
|