Upload 7 files
Browse files- .gitattributes +6 -0
- README.md +95 -3
- xLAM-1B-FC-r.F16.gguf +3 -0
- xLAM-1B-FC-r.Q2_K.gguf +3 -0
- xLAM-1B-FC-r.Q4_0.gguf +3 -0
- xLAM-1B-FC-r.Q4_K_M.gguf +3 -0
- xLAM-1B-FC-r.Q4_K_S.gguf +3 -0
- xLAM-1B-FC-r.Q8_0.gguf +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
xLAM-1B-FC-r.F16.gguf filter=lfs diff=lfs merge=lfs -text
|
37 |
+
xLAM-1B-FC-r.Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
|
38 |
+
xLAM-1B-FC-r.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
39 |
+
xLAM-1B-FC-r.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
40 |
+
xLAM-1B-FC-r.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
41 |
+
xLAM-1B-FC-r.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,95 @@
|
|
1 |
-
---
|
2 |
-
license: cc-by-
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"><a href="https://apigen-pipeline.github.io/">[🏠Homepage]</a> | <a href="https://coder.deepseek.com/">[📄 Paper]</a> | <a href="https://coder.deepseek.com/">[📚 Dataset]</a></p>
|
8 |
+
<hr>
|
9 |
+
|
10 |
+
## Model Summary
|
11 |
+
|
12 |
+
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/agentstudio-family/xLAM-1B-FC-r)
|
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 Overview
|
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 |
+
|
22 |
+
1. **Install Hugging Face CLI:**
|
23 |
+
|
24 |
+
```
|
25 |
+
pip install huggingface-hub>=0.17.1
|
26 |
+
```
|
27 |
+
|
28 |
+
2. **Login to Hugging Face:**
|
29 |
+
```
|
30 |
+
huggingface-cli login
|
31 |
+
```
|
32 |
+
|
33 |
+
3. **Download the GGUF model:**
|
34 |
+
```
|
35 |
+
huggingface-cli download agentstudio-family/xLAM-1b-fc-gguf-r xLAM-1B-FC-r.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
|
36 |
+
```
|
37 |
+
|
38 |
+
## Prompt template
|
39 |
+
```
|
40 |
+
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
|
41 |
+
### Instruction:
|
42 |
+
[BEGIN OF TASK INSTRUCTION]
|
43 |
+
{task_instruction}
|
44 |
+
[END OF TASK INSTRUCTION]
|
45 |
+
|
46 |
+
[BEGIN OF AVAILABLE TOOLS]
|
47 |
+
{xlam_format_tools}
|
48 |
+
[END OF AVAILABLE TOOLS]
|
49 |
+
|
50 |
+
[BEGIN OF FORMAT INSTRUCTION]
|
51 |
+
{format_instruction}
|
52 |
+
[END OF FORMAT INSTRUCTION]
|
53 |
+
|
54 |
+
[BEGIN OF QUERY]
|
55 |
+
{query}
|
56 |
+
[END OF QUERY]
|
57 |
+
|
58 |
+
### Response:
|
59 |
+
|
60 |
+
```
|
61 |
+
For more information, refer to [prompt-documentation](https://huggingface.co/agentstudio-family/xLAM-1B-FC-r#basic-usage-with-huggingface)
|
62 |
+
## Usage
|
63 |
+
|
64 |
+
### Command Line
|
65 |
+
|
66 |
+
1. Install llama.cpp framework from the source [here](https://github.com/ggerganov/llama.cpp)
|
67 |
+
2. Run the inference task as below, to configure generation related paramter, refer to [llama.cpp](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
|
68 |
+
```
|
69 |
+
./llama-cli -m [PATH-TO-LOCAL-GGUF] -p "[PROMPT]"
|
70 |
+
```
|
71 |
+
3. Example
|
72 |
+
```
|
73 |
+
./llama-cli -m xLAM-1B-FC-r.Q8_0.gguf -p "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### Instruction:\n[BEGIN OF TASK INSTRUCTION]\nYou are an expert in composing functions. You are given a question and a set of possible functions.\nBased on the question, you will need to make one or more function/tool calls to achieve the purpose.\nIf none of the functions can be used, point it out and refuse to answer.\nIf the given question lacks the parameters required by the function, also point it out.\n[END OF TASK INSTRUCTION]\n\n[BEGIN OF AVAILABLE TOOLS]\n{\"name\": \"get_weather\", \"description\": \"Get the current weather for a location\", \"parameters\": {\"location\": {\"type\": \"string\", \"description\": \"The city and state, e.g. San Francisco, CA\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"], \"description\": \"The unit of temperature to return\"}}}\n[END OF AVAILABLE TOOLS]\n\n[BEGIN OF FORMAT INSTRUCTION]\nThe output MUST strictly adhere to the following JSON format, and NO other text MUST be included.\nThe 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 '[]'\n```\n{\n \"tool_calls\": [\n {\"name\": \"func_name1\", \"arguments\": {\"argument1\": \"value1\", \"argument2\": \"value2\"}},\n ... (more tool calls as required)\n ]\n}\n```\n[END OF FORMAT INSTRUCTION]\n\n[BEGIN OF QUERY]\nWhat's the weather forecast for Tokyo?\n[END OF QUERY]\n\n\n### Response:"
|
74 |
+
|
75 |
+
```
|
76 |
+
|
77 |
+
### Python framwork
|
78 |
+
|
79 |
+
1. Install [llama-cpp-python](https://github.com/abetlen/llama-cpp-python)
|
80 |
+
```
|
81 |
+
pip install llama-cpp-python
|
82 |
+
```
|
83 |
+
2. Refer to [llama-cpp-API](https://github.com/abetlen/llama-cpp-python?tab=readme-ov-file#high-level-api), here's a example below
|
84 |
+
```python
|
85 |
+
from llama_cpp import Llama
|
86 |
+
|
87 |
+
llm = Llama(
|
88 |
+
model_path="[PATH-TO-MODEL]"
|
89 |
+
)
|
90 |
+
output = llm(
|
91 |
+
"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### Instruction:\n[BEGIN OF TASK INSTRUCTION]\nYou are an expert in composing functions. You are given a question and a set of possible functions.\nBased on the question, you will need to make one or more function/tool calls to achieve the purpose.\nIf none of the functions can be used, point it out and refuse to answer.\nIf the given question lacks the parameters required by the function, also point it out.\n[END OF TASK INSTRUCTION]\n\n[BEGIN OF AVAILABLE TOOLS]\n{\"name\": \"get_weather\", \"description\": \"Get the current weather for a location\", \"parameters\": {\"location\": {\"type\": \"string\", \"description\": \"The city and state, e.g. San Francisco, CA\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"], \"description\": \"The unit of temperature to return\"}}}\n[END OF AVAILABLE TOOLS]\n\n[BEGIN OF FORMAT INSTRUCTION]\nThe output MUST strictly adhere to the following JSON format, and NO other text MUST be included.\nThe 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 '[]'\n```\n{\n \"tool_calls\": [\n {\"name\": \"func_name1\", \"arguments\": {\"argument1\": \"value1\", \"argument2\": \"value2\"}},\n ... (more tool calls as required)\n ]\n}\n```\n[END OF FORMAT INSTRUCTION]\n\n[BEGIN OF QUERY]\nWhat's the weather forecast for Tokyo?\n[END OF QUERY]\n\n\n### Response:",
|
92 |
+
echo=True # Echo the prompt back in the output
|
93 |
+
) # Generate a completion, can also call create_completion
|
94 |
+
print(output)
|
95 |
+
```
|
xLAM-1B-FC-r.F16.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:40cf3764bce64bb972244177ca03c78fcd90af582c98ac997a5ba43099a2c971
|
3 |
+
size 2694314368
|
xLAM-1B-FC-r.Q2_K.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:47608d7df20f3e2514140310f0c0273dcdaab94e2d6f0acc0da50b20466d5068
|
3 |
+
size 559716736
|
xLAM-1B-FC-r.Q4_0.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:79e63407a3d4d545ebd72b0fa8800bfd8f0ac724e45feb5402d8e55f057801a9
|
3 |
+
size 775936384
|
xLAM-1B-FC-r.Q4_K_M.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5ea7b14f8594698e074c4613ecee2529504ae12d7e1297ef0ea201fcc1dc1f92
|
3 |
+
size 873453952
|
xLAM-1B-FC-r.Q4_K_S.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2d6714708355339735f59958d2e594fa599cb79ba8fbdbc239ad54fc233ee676
|
3 |
+
size 813963648
|
xLAM-1B-FC-r.Q8_0.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9fc3e2ae20a447d9402d595007dcbb4ec18bf2b96b4b4fa9c132c763ef292385
|
3 |
+
size 1432091008
|