gemma-7b not support function call. please add support for it

#38
by akxor - opened

The openai chatgpt can make function call,

but gemma-7b not able to understand function call.

please add it.

See: https://platform.openai.com/docs/guides/function-calling

and the basic test:

curl --location 'http://localhost:11434/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
  "model": "gemma:7b-instruct",
  "messages": [
    {"role": "user", "content": "What is the weather like in Boston?"}
  ],
  "functions": [
    {
      "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"]
      }
    }
  ]
}'

wish result:

ChatCompletionMessage(content='{\n  "location": "Toronto, Canada",\n  "format": "celsius"\n}', role='assistant', function_call=None, tool_calls=None)

what really result

{
    "id": "chatcmpl-83",
    "object": "chat.completion",
    "created": 1708677811,
    "model": "gemma:7b-instruct",
    "system_fingerprint": "fp_ollama",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "I do not have access to real-time information, therefore I cannot provide you with the current weather conditions in Boston. However, you can check a website like weather.com or your local news station for the most up-to-date information."
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 17,
        "completion_tokens": 51,
        "total_tokens": 68
    }
}
Google org

What sorts of functions or capabilities would you like to see in particular?

What sorts of functions or capabilities would you like to see in particular?

custom search from web/ from database/ from wikipedia.
with these custom function call, we can tell AI we know ,and AI can make some summary, explain, and tell us more deeply with it.

We build business Apps with AI powered . we need the ability to call functions.

thanks.

@suryabhupa Google has any plan to support function calling with gemma-7b? any news update for us?

Google org

That makes sense, and I agree with you that it'd be a great feature -- we'll be looking into it!

suryabhupa changed discussion status to closed

Sign up or log in to comment