bodhicitta / gemma-2b-function-call

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: April 30 2024

Introduction of gemma-2b-function-call

Model Details of gemma-2b-function-call

Model Card for Model ID

Gemma 2B function calling. google/gemma-2b-it finetuned on hypervariance/function-calling-sharegpt .

Usage

Make sure you have the peft package installed. You can install it with pip install peft .

from transformers import AutoModelForCausalLM , AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bodhicitta/gemma-2b-function-call", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("bodhicitta/gemma-2b-function-call", trust_remote_code=True, device_map="auto")

inputs = tokenizer(prompt,return_tensors="pt").to(model.device)

outputs = model.generate(**inputs,do_sample=True,temperature=0.1,top_p=0.95,max_new_tokens=100)

print(tokenizer.decode(outputs[0]))

You can also use sharegpt formatted prompts:

from transformers import AutoModelForCausalLM , AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bodhicitta/gemma-2b-function-call", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("bodhicitta/gemma-2b-function-call", trust_remote_code=True, device_map="auto")

chat = [
  {
      "from": "system",
      "value": "SYSTEM PROMPT",
  },
  {
      "from": "human",
      "value": "USER QUESTION"
  },
]

prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

outputs = model.generate(**inputs,do_sample=True,temperature=0.1,top_p=0.95,max_new_tokens=100)

print(tokenizer.decode(outputs[0]))
Prompt template
You are a helpful assistant with access to the following functions. Use them if required -
{
    "name": "function name",
    "description": "function description",
    "parameters": {
        "type": "type (object/number/string)",
        "properties": {
            "property_1": {
                "type": "type",
                "description": "property description"
            }
        },
        "required": [
            "property_1"
        ]
    }
}

To use these functions respond with:
<functioncall> {"name": "function_name", "arguments": {"arg_1": "value_1", "arg_1": "value_1", ...}} </functioncall>

Edge cases you must handle:
 - If there are no functions that match the user request, you will respond politely that you cannot help.

User Question:
USER_QUESTION

Function calls are enclosed in <functioncall> </functioncall> .

The model was trained using the same delimiters as google/gemma-2b-it :

<bos><start_of_turn>user
Write a hello world program<end_of_turn>
<start_of_turn>model

Use <end_of_turn> stop sequence to prevent the model from generating further text.

Runs of bodhicitta gemma-2b-function-call on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About gemma-2b-function-call huggingface.co Model

gemma-2b-function-call huggingface.co

gemma-2b-function-call huggingface.co is an AI model on huggingface.co that provides gemma-2b-function-call's model effect (), which can be used instantly with this bodhicitta gemma-2b-function-call model. huggingface.co supports a free trial of the gemma-2b-function-call model, and also provides paid use of the gemma-2b-function-call. Support call gemma-2b-function-call model through api, including Node.js, Python, http.

gemma-2b-function-call huggingface.co Url

https://huggingface.co/bodhicitta/gemma-2b-function-call

bodhicitta gemma-2b-function-call online free

gemma-2b-function-call huggingface.co is an online trial and call api platform, which integrates gemma-2b-function-call's modeling effects, including api services, and provides a free online trial of gemma-2b-function-call, you can try gemma-2b-function-call online for free by clicking the link below.

bodhicitta gemma-2b-function-call online free url in huggingface.co:

https://huggingface.co/bodhicitta/gemma-2b-function-call

gemma-2b-function-call install

gemma-2b-function-call is an open source model from GitHub that offers a free installation service, and any user can find gemma-2b-function-call on GitHub to install. At the same time, huggingface.co provides the effect of gemma-2b-function-call install, users can directly use gemma-2b-function-call installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

gemma-2b-function-call install url in huggingface.co:

https://huggingface.co/bodhicitta/gemma-2b-function-call

Url of gemma-2b-function-call

gemma-2b-function-call huggingface.co Url

Provider of gemma-2b-function-call huggingface.co

bodhicitta
ORGANIZATIONS

Other API from bodhicitta

huggingface.co

Total runs: 783
Run Growth: 590
Growth Rate: 75.35%
Updated:November 27 2025