314 1 year ago

Function calling Mistral 7b instruct model finetuned on glaive-function-calling-v2 dataset

1 year ago

b892fbfe479b · 4.2GB

llama
·
7.24B
·
Q4_0
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR US
{ "stop": [ "[INST]", "[/INST]" ] }
[INST] {{ .System }} {{ .Prompt }} [/INST]
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR US

Readme

Mistral 7b instruct v2 model finetuned for function calling using Glaive Function Calling v2 Dataset. The model was finetuned on 5000 samples over 2 epochs.

Use a prompt template similar to this:

fc_prompt = PromptTemplate.from_template("""SYSTEM: You are a helpful assistant with access to the following functions. Use them if required -     
{tools}                                                                                                                                            
                                                                                                                                                   
The output needs to be in the following format:                                                                                                    
{{                                                                                                                                                 
    'name': <function name>,                                                                                                                       
    'arguments': <arguments to pass to the function>                                                                                               
}}                                                                                                                                                 
                                                                                                                                                   
For questions not related to tools above, respond with an empty json object.                                            
                                                                                                                                                   
User: {question}                                                                                                                                   
FUNCTION: """, partial_variables={"tools": tool_descriptions})