Comments (3)
Hi @ChristianWeyer! Thanks for your interest~
We provide GGUF quantized model and example inference walkthrough on https://huggingface.co/gorilla-llm/gorilla-openfunctions-v2-gguf if you are looking for doing inference on compressed model. We've tested them on consumer laptop!
We also provide example inference code for the original model, which you can check out this section in github repo https://github.com/ShishirPatil/gorilla/tree/main/openfunctions#end-to-end-example-1
Let us know if you encounter further issues! We're happy to provide support!
from gorilla.
I am trying the Q6_K quant together with Ollama and LiteLLM @ShishirPatil.
litellm --model ollama/adrienbrault/gorilla-openfunctions-v2:Q6_K
It does look to work OK... but the devil is in the details 😉.
This is the curl command:
curl $TARGET_URL \
-H "Content-Type: application/json" \
-d '{
"model": $MODEL:NAME,
"messages": [
{
"role": "user",
"content": "What is the weather like in Boston?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location"]
}
}
}
],
"tool_choice": "auto"
}'
Running this against OpenAI gpt.3.5.turbo
, we get this result:
{
"choices" : [
{
"finish_reason" : "tool_calls",
"index" : 0,
"logprobs" : null,
"message" : {
"content" : null,
"role" : "assistant",
"tool_calls" : [
{
"function" : {
"arguments" : "{\"location\":\"Boston\"}",
"name" : "get_current_weather"
},
"id" : "call_regvlJdOsVla1XbVBnWWvduA",
"type" : "function"
}
]
}
}
],
"created" : 1710859864,
"id" : "chatcmpl-94V5sy20kdgIReFCKiID6rUDrVAyF",
"model" : "gpt-3.5-turbo-0125",
"object" : "chat.completion",
"system_fingerprint" : "fp_4f2ebda25a",
"usage" : {
"completion_tokens" : 15,
"prompt_tokens" : 82,
"total_tokens" : 97
}
}
However, when run against the local OpenFunctions endpoint, we get:
{
"choices" : [
{
"finish_reason" : "stop",
"index" : 0,
"message" : {
"content" : null,
"role" : "assistant",
"tool_calls" : [
{
**"function" : {
"arguments" : "{\n \"name\": \"get_current_weather\", \n \"arguments\": {\"location\": \"Boston, MA\"}\n}\n",
"name" : ""
},**
"id" : "call_7e88f79b-b4d7-4f42-8c0d-363414ff6e08",
"type" : "function"
}
]
}
}
],
"created" : 1710859673,
"id" : "chatcmpl-db75896e-8236-47ee-8cf5-14f94811fab2",
"model" : "ollama/adrienbrault/gorilla-openfunctions-v2:Q6_K",
"object" : "chat.completion",
"system_fingerprint" : null,
"usage" : {
"completion_tokens" : 31,
"prompt_tokens" : 167,
"total_tokens" : 198
}
}
This means the OpenFunctions answer is not really OAI Tool Calling spec-compliant.
Any idea what we can do here?
Thanks!
from gorilla.
Maybe, this is actually an issue with LiteLLM (BerriAI/litellm#2209)
from gorilla.
Related Issues (20)
- RAFT raft.py CLI arguments naming broke `--embedding-model` and `--completion-model` in PR #410 HOT 1
- Java/Javascript split questions HOT 1
- How to evaluate android function call[feature] HOT 1
- [bug] LlamaHandler format HOT 4
- Leaderboard data bug + suggested fix HOT 1
- [bug] Hosted Gorilla: Expired HTTPS certificate HOT 2
- how to test new model on BFCL? HOT 2
- [bug] openfunctions-v2 default chat template
- [feature] Add multi-turn conversational function calling category for benchmarking HOT 1
- the evaluation of class relevance in BFCL maybe unfair HOT 1
- What format was used for the final fine-tuning of LLaMA2-7B in RAFT? HOT 1
- [bug] Hosted Gorilla: <Issue> HOT 6
- The Urban Dictionary from the RapidAPI is not serving, can't evaluate execution data
- auto fill missed mandatory param is a nightmare HOT 3
- [bug] Hosted Gorilla: <Issue> HOT 2
- [bug] Hosted Gorilla: <Issue> HOT 1
- [bug] Hosted Gorilla: <Issue> HOT 2
- Rapid API error (Yahoo Finance, https://rapidapi.com/sparior/api/yahoo-finance15) is inaccessible HOT 5
- Local CUDA Support for RAFT
- Revamp Landing README HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gorilla.