function calling

#18
by ybsid - opened

Hi , Great work with the model, very much appreciated.

I'd like to know if this model can support function calling to extract structured outputs.

If yes , are there any code samples to allow local function-calling via llama.cpp or any other libs ?

You can give it a try with my dataset for function calling Q&A

https://huggingface.co/datasets/Yhyu13/glaive-function-calling-v2-llama-factory-convert

e.g.

"SYSTEM: You are a helpful assistant with access to the following functions. Use them if required -\n{\n \"name\": \"get_news_headlines\",\n \"description\": \"Get the latest news headlines\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"country\": {\n \"type\": \"string\",\n \"description\": \"The country for which to fetch news\"\n }\n },\n \"required\": [\n \"country\"\n ]\n }\n}\n\nCan you tell me the latest news headlines for the United States?"

and see if the response contains function calling json

The output isn't stable enough.
Mistral in quite unique as it tries to explain it's answer and this isn't great for extracting structured formatting.

Langchain isnt't much useful as well , as most of it's prompts and parsing is tuned for on GPT-3.5/4

Any other suggestions I could get structured output most of the times ?

I know it could be fine tuned , but I couldn't find anyway to fine-tune a gguf model.

Maybe 1 shot prompting by including a function calling response example in the prompt?

look into DSPy!

Sign up or log in to comment