Model Card for Model ID
This model is merged with peft fine tuned model and it is standalone model.
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.
- 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 due to which Bias and error are prone
How to Get Started with the Model
Use the code below to get started with the model.
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",
) # For GPU
tokenizer = AutoTokenizer.from_pretrained(model_id)
# model.to(torch.bfloat16)
model.eval()
generator = pipeline("text-generation", model= model, tokenizer= tokenizer)
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)
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: [T4 24GPU]
- Hours used: [4 hours]
- Downloads last month
- 6
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
2
Ask for provider support
Model tree for langdai/gemma-2-2b-it-tool-think
Base model
google/gemma-2b-it