-
Notifications
You must be signed in to change notification settings - Fork 75
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 LLAMA 3.1 Json tool call with Bumblebee #198
base: main
Are you sure you want to change the base?
Conversation
In the example, I added: @brainlid before merge in the example notebook, we should change that import, if you like everything else so far. |
README.md
Outdated
@@ -201,6 +201,7 @@ For example, if a locally running service provided that feature, the following c | |||
Bumblebee hosted chat models are supported. There is built-in support for Llama 2, Mistral, and Zephyr models. | |||
|
|||
Currently, function calling is NOT supported with these models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rephrase this to
"Currently, function calling is only supported for llama 3.1 Tool calling for Llama 2, Mistral, and Zephyr is NOT supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the code formatter could also be run.
Thanks for all this work!
lib/chat_models/chat_bumblebee.ex
Outdated
|
||
def do_serving_request(%ChatBumblebee{template_format: :llama_3_1_json_tool_calling} = model, messages, functions) do | ||
prompt = ChatTemplates.apply_chat_template_with_tools!(messages, model.template_format,functions) | ||
|> IO.inspect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the IO.inspect
Sorry, change what import? |
{:exla, ">= 0.0.0"}, | ||
{:axon, ">= 0.5.1"}, | ||
{:nx, ">= 0.5.1"}, | ||
{:langchain, github: "marcnnn/langchain", branch: "llama3_1_json_tool"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should import just the latest version after published.
Thanks for the feedback! |
This PR adds the Basic JSON tool calling functionality for LLAMA 3.1
The output is not as stable as I hoped it would be, maybe I need to adjust the template a little.
The tool calling will only be used if you use the template: