Giter Club home page Giter Club logo

Comments (2)

JasonZhu1313 avatar JasonZhu1313 commented on June 12, 2024 1

@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.

CharlieJCJ avatar CharlieJCJ commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.