đ Model Card for Model ID
This model is a standalone one merged with a PEFT fine - tuned model.
đ Quick Start
Use the code below to get started with the model.
Basic Usage
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from transformers import pipeline
import torch
model_id = "langdai/gemma-2-2b-it-tool-think"
model = AutoModelForCausalLM.from_pretrained(model_id,
device_map="cuda:0",
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
model.eval()
generator = pipeline("text-generation", model= model, tokenizer= tokenizer)
Advanced Usage
prompt="""<bos><start_of_turn>human
You are a function calling AI model. You are provided with function signatures within <tools></tools> XML tags.You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions.Here are the available tools:<tools> [{'type': 'function', 'function': {'name': 'convert_currency', 'description': 'Convert from one currency to another', 'parameters': {'type': 'object', 'properties': {'amount': {'type': 'number', 'description': 'The amount to convert'}, 'from_currency': {'type': 'string', 'description': 'The currency to convert from'}, 'to_currency': {'type': 'string', 'description': 'The currency to convert to'}}, 'required': ['amount', 'from_currency', 'to_currency']}}}, {'type': 'function', 'function': {'name': 'calculate_distance', 'description': 'Calculate the distance between two locations', 'parameters': {'type': 'object', 'properties': {'start_location': {'type': 'string', 'description': 'The starting location'}, 'end_location': {'type': 'string', 'description': 'The ending location'}}, 'required': ['start_location', 'end_location']}}}] </tools>Use the following pydantic model json schema for each tool call you will make: {'title': 'FunctionCall', 'type': 'object', 'properties': {'arguments': {'title': 'Arguments', 'type': 'object'}, 'name': {'title': 'Name', 'type': 'string'}}, 'required': ['arguments', 'name']}For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags as follows:
<tool_call>
{tool_call}
</tool_call>Also, before making a call to a function take the time to plan the function to take. Make that thinking process between <think>{your thoughts}</think>
Hi, I need to convert 500 INR to Euros. Can you help me with that?<end_of_turn><eos>
<start_of_turn>model
<think>"""
output = generator([{"role": "user", "content": prompt}], max_new_tokens=512, return_full_text=False)[0]
print(output)
⨠Features
- This model is merged with a PEFT fine - tuned model and is a standalone model.
- gemma - 2b - it cannot be used for tool call and responds with reasoning like the recent developed Deepseek r1. These limitations are considered during fine - tuning.
đ Documentation
Model Details
Model Description
This is the model card of a đ¤ transformers model that has been pushed on the Hub. This model card has been automatically generated.
Property |
Details |
Developed by |
[Liching] |
Funded by |
[hobby] |
Model Type |
[text - generation] |
Language(s) (NLP) |
[En] |
License |
[MIT] |
Finetuned from model |
[gemma - 2b - it] |
Uses
gemma - 2b - it cannot be used for tool call and responds with reasoning like the recent developed Deepseek r1. These limitations are taken into consideration by fine - tuning the model.
Bias, Risks, and Limitations
The Model is finetuned for 1 epoch, making it prone to bias and errors.
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
Property |
Details |
Hardware Type |
[T4 24GPU] |
Hours used |
[4 hours] |
đ License
This model is licensed under the MIT license.