|
--- |
|
license: llama2 |
|
tags: |
|
- functions |
|
- llama2 |
|
- gguf |
|
--- |
|
A gguf version of the v1 model of llama 2 function calling model in: |
|
- fLlama-2-7b-chat.q3_K_M.gguf |
|
GGUF versions of v3 in: |
|
- Llama-2-7b-chat-hf-function-calling-v3-Q4_0.gguf |
|
- Llama-2-7b-chat-hf-function-calling-v3-Q_4_K_M.gguf |
|
- Llama-2-7b-chat-hf-function-calling-v3-Q2_K.gguf |
|
|
|
Set up like so: |
|
```Python |
|
[INST] You have access to the following functions. Use them if required: |
|
|
|
[ |
|
{ |
|
"type": "function", |
|
"function": { |
|
"name": "get_big_stocks", |
|
"description": "Get the names of the largest N stocks by market cap", |
|
"parameters": { |
|
"type": "object", |
|
"properties": { |
|
"number": { |
|
"type": "integer", |
|
"description": "The number of largest stocks to get the names of, e.g. 25" |
|
}, |
|
"region": { |
|
"type": "string", |
|
"description": "The region to consider, can be \"US\" or \"World\"." |
|
} |
|
}, |
|
"required": [ |
|
"number" |
|
] |
|
} |
|
} |
|
}, |
|
{ |
|
"type": "function", |
|
"function": { |
|
"name": "get_stock_price", |
|
"description": "Get the stock price of an array of stocks", |
|
"parameters": { |
|
"type": "object", |
|
"properties": { |
|
"names": { |
|
"type": "array", |
|
"items": { |
|
"type": "string" |
|
}, |
|
"description": "An array of stocks" |
|
} |
|
}, |
|
"required": [ |
|
"names" |
|
] |
|
} |
|
} |
|
} |
|
] |
|
|
|
[INST] Get the names of the five largest stocks in the US by market cap [/INST] |
|
|
|
{ |
|
"name": "get_big_stocks", |
|
"arguments": { |
|
"number": 5, |
|
"region": "US" |
|
} |
|
}</s> |
|
``` |
|
|
|
or this: |
|
|
|
```Python |
|
<s>[INST] <<SYS>> |
|
You are a helpful research assistant. The following functions are available for you to fetch further data to answer user questions, if relevant: |
|
|
|
{ |
|
"function": "search_bing", |
|
"description": "Search the web for content on Bing. This allows users to search online/the internet/the web for content.", |
|
"arguments": [ |
|
{ |
|
"name": "query", |
|
"type": "string", |
|
"description": "The search query string" |
|
} |
|
] |
|
} |
|
|
|
{ |
|
"function": "search_arxiv", |
|
"description": "Search for research papers on ArXiv. Make use of AND, OR and NOT operators as appropriate to join terms within the query.", |
|
"arguments": [ |
|
{ |
|
"name": "query", |
|
"type": "string", |
|
"description": "The search query string" |
|
} |
|
] |
|
} |
|
|
|
|
|
To call a function, respond - immediately and only - with a JSON object of the following format: |
|
{ |
|
"function": "function_name", |
|
"arguments": { |
|
"argument1": "argument_value", |
|
"argument2": "argument_value" |
|
} |
|
} |
|
<</SYS>>[/INST] |
|
|
|
[INST] Find papers on high pressure batch reverse osmosis [/INST] |
|
``` |
|
|
|
Good results through standard llama.cpp chat web interface - also can be used for openai proxy. |
|
|
|
Original Creds go here: |
|
|
|
(Trelis/Llama-2-7b-chat-hf-function-calling-v3)[https://huggingface.co/Trelis/Llama-2-7b-chat-hf-function-calling-v3] |