aashish1904 commited on
Commit
e854d30
·
verified ·
1 Parent(s): bfdbed3

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +114 -0
README.md ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ pipeline_tag: text-generation
5
+ base_model: functionary-small-v2.2
6
+ library_name: transformers
7
+
8
+ ---
9
+
10
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
11
+
12
+
13
+ # QuantFactory/functionary-small-v2.2-GGUF
14
+ This is quantized version of [meetkai/functionary-small-v2.2](https://huggingface.co/meetkai/functionary-small-v2.2) created using llama.cpp
15
+
16
+ # Original Model Card
17
+ # Model Card for functionary-small-v2.2
18
+
19
+ [https://github.com/MeetKai/functionary](https://github.com/MeetKai/functionary)
20
+
21
+ ![Functionary Logo](https://huggingface.co/meetkai/functionary-medium-v2.2/resolve/main/functionary_logo.jpg "Functionary Logo")
22
+
23
+ Functionary is a language model that can interpret and execute functions/plugins.
24
+
25
+ The model determines when to execute functions, whether in parallel or serially, and can understand their outputs. It only triggers functions as needed. Function definitions are given as JSON Schema Objects, similar to OpenAI GPT function calls.
26
+
27
+ ## Key Features
28
+
29
+ - Intelligent **parallel tool use**
30
+ - Able to analyze functions/tools outputs and provide relevant responses **grounded in the outputs**
31
+ - Able to decide **when to not use tools/call functions** and provide normal chat response
32
+ - Truly one of the best open-source alternative to GPT-4
33
+
34
+ ## Performance
35
+
36
+ Our model achieves achieves state-of-the-art performance in Function Calling Accuracy on our in-house dataset. The accuracy metric measures the overall correctness of predicted function calls, including function name prediction and arguments extraction.
37
+
38
+ ![Eval Chart](https://huggingface.co/meetkai/functionary-medium-v2.2/resolve/main/evaluation_chart.jpeg "Eval Chart")
39
+
40
+ | Dataset | Model Name | Function Calling Accuracy (Name & Arguments) |
41
+ | :-------------| :-------------------| ---------------------------: |
42
+ | In-house data | MeetKai-functionary-small-v2.2 | 0.546|
43
+ | In-house data | MeetKai-functionary-medium-v2.2 | **0.664**|
44
+ | In-house data | OpenAI-gpt-3.5-turbo-1106 | 0.531 |
45
+ | In-house data | OpenAI-gpt-4-1106-preview | 0.737 |
46
+
47
+ ## Prompt Template
48
+
49
+ We use a specially designed prompt template which we call "v2PromptTemplate" that breaks down each turns into from, recipient and content portions.
50
+
51
+ We convert function definitions to a similar text to TypeScript definitions. Then we inject these definitions as system prompts. After that, we inject the default system prompt. Then we start the conversation messages.
52
+
53
+ This formatting is also available via our vLLM server which we process the functions into Typescript definitions encapsulated in a system message and use a pre-defined Transformers chat template. This means that lists of messages can be formatted for you with the apply_chat_template() method within our server:
54
+
55
+ ```python
56
+ from openai import OpenAI
57
+
58
+ client = OpenAI(base_url="http://localhost:8000/v1", api_key="functionary")
59
+
60
+ client.chat.completions.create(
61
+ model="path/to/functionary/model/",
62
+ messages=[{"role": "user",
63
+ "content": "What is the weather for Istanbul?"}
64
+ ],
65
+ tools=[{
66
+ "type": "function",
67
+ "function": {
68
+ "name": "get_current_weather",
69
+ "description": "Get the current weather",
70
+ "parameters": {
71
+ "type": "object",
72
+ "properties": {
73
+ "location": {
74
+ "type": "string",
75
+ "description": "The city and state, e.g. San Francisco, CA"
76
+ }
77
+ },
78
+ "required": ["location"]
79
+ }
80
+ }
81
+ }],
82
+ tool_choice="auto"
83
+ )
84
+ ```
85
+
86
+ will yield:
87
+
88
+ ```
89
+ <|from|>system
90
+ <|recipient|>all
91
+ <|content|>// Supported function definitions that should be called when necessary.
92
+ namespace functions {
93
+ // Get the current weather
94
+ type get_current_weather = (_: {
95
+ // The city and state, e.g. San Francisco, CA
96
+ location: string,
97
+ }) => any;
98
+ } // namespace functions
99
+ <|from|>system
100
+ <|recipient|>all
101
+ <|content|>A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. The assistant calls functions with appropriate input when necessary
102
+ <|from|>user
103
+ <|recipient|>all
104
+ <|content|>What is the weather for Istanbul?
105
+ ```
106
+
107
+ A more detailed example is provided [here](https://github.com/MeetKai/functionary/blob/main/tests/prompt_test_v2.txt).
108
+
109
+ ## Run the model
110
+
111
+ We encourage users to run our models using our OpenAI-compatible vLLM server [here](https://github.com/MeetKai/functionary).
112
+
113
+ # The MeetKai Team
114
+ ![MeetKai Logo](https://huggingface.co/meetkai/functionary-medium-v2.2/resolve/main/meetkai_logo.png "MeetKai Logo")