Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a recipe that works with function calling models #562

Closed
lstocchi opened this issue Jun 14, 2024 · 5 comments · Fixed by #794
Closed

Add a recipe that works with function calling models #562

lstocchi opened this issue Jun 14, 2024 · 5 comments · Fixed by #794

Comments

@lstocchi
Copy link
Collaborator

In podman desktop ai lab we are planning to add function calling models support -> containers/podman-desktop-extension-ai-lab#1116

We would need a recipe + a list of recommended models to work with

@axel7083
Copy link
Contributor

Depends on #601

@rhatdan
Copy link
Member

rhatdan commented Jun 24, 2024

#601 merged, can we close this?

@lstocchi
Copy link
Collaborator Author

lstocchi commented Jun 25, 2024

@rhatdan no. This issue is related to the need to have something similar to the chatbot/rag recipe. So we can add it to ai-lab extension.
The user downloads the recipe, play with it, check the code how to rewrite a similar app ....

@axel7083
Copy link
Contributor

axel7083 commented Aug 6, 2024

@axel7083
Copy link
Contributor

axel7083 commented Aug 6, 2024

I made some experiments locally with the amazing Instructor library and here are some demos I made using llama-cpp-python 0.83 (any version above crashes)

Instructor library

Information extraction

Given an unstructured text, return a python model.

demo-instructor-1.mp4

A basic pydantic model provided, the instructor will translate the llm response to the model provided, with validation etc.

Single text classification

demo-instructor-single-classification.mp4

Given an enum and a text, got the enum value as result. Allowing basic single text classification.

Multi text classification

demo-multi-classification.mp4

We can request multiple values as result, allowing to get a multi-classification.

Function calling

The function calling need a bit of manual change, as we need abetlen/llama-cpp-python#1509 applied, and some adjustment to be able to uses the functionary-v2.51 model.

demo-function-calling.mp4

Thoses example are took from the llama-cpp-python repository2

Footnotes

  1. https://huggingface.co/meetkai/functionary-small-v2.5-GGUF/tree/main

  2. https://github.com/abetlen/llama-cpp-python/blob/main/examples/notebooks/Functions.ipynb

jeffmaury added a commit to jeffmaury/ai-lab-recipes that referenced this issue Sep 24, 2024
@rhatdan rhatdan closed this as completed in 900f548 Oct 2, 2024
rhatdan added a commit that referenced this issue Oct 2, 2024
feat: add function calling recipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants