Comments (2)
@CharlieJCJ @ShishirPatil Hey, thanks for detailed response, I started a PR #360 to support openfunctionv2 handler to address this issue #360, will finish the test hopefully by end of day so we can close this issue.
from gorilla.
Hi Jason, thanks for your interest in Berkeley Function-Calling Leaderboard!
Responding to your question, there are two things we want to raise. First, we noticed that you added special tokens in places, namely at the start of the system prompt and user prompt <s>
[INST]
, and [/INST]
.
system = "<s>[INST] You are an AI programming assistant, utilizing the Gorilla LLM model, developed by Gorilla LLM, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer."
return f"{system}\n### Instruction: <<question>> {user_query}\n### Response: [/INST]"
return f"{system}\n### Instruction: <<function>>{functions_string}\n<<question>>{user_query}\n### Response: [/INST]"
We provide get_prompt
function in repo and huggingface, consistent with our hosted endpoint’s inference, and defined as follows. Please use our official get_prompt
method in your oss evaluation for replication for consistency in evalution. Thank you!
def get_prompt(user_query: str, functions: list = []) -> str:
"""
Generates a conversation prompt based on the user's query and a list of functions.
Parameters:
- user_query (str): The user's query.
- functions (list): A list of functions to include in the prompt.
Returns:
- str: The formatted conversation prompt.
"""
system = "You are an AI programming assistant, utilizing the Gorilla LLM model, developed by Gorilla LLM, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer."
if len(functions) == 0:
return f"{system}\n### Instruction: <<question>> {user_query}\n### Response: "
functions_string = json.dumps(functions)
return f"{system}\n### Instruction: <<function>>{functions_string}\n<<question>>{user_query}\n### Response: "
Secondly, our oss_handler
is not intended to evaluate gorilla-openfunctions-v2
(vllm hosted) at the moment, since we inference oss models’ responses through a format that is not consistent with that of gorilla-openfunctions-v2
. We support evaluation on our hosted endpoint through gorilla_handler
(through API calls to our hosted endpoint), thus one should use the decode_ast
, decode_execute
defined in gorilla_handler
to parse gorilla responses, instead of those defined in oss_handler
.
We will support evaluating vllm hosted gorilla-openfunctions-v2
for reproducibility and then close the issue shortly via a new PR. Thanks again for flagging this to our attention!
from gorilla.
Related Issues (20)
- 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
- [bug] OpenFunctions-v2: <Issue>
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.