--- base_model: meta-llama/Llama-3.2-3B-Instruct library_name: transformers model_name: Llama-3.2-3B-Instruct-thinking-function_calling-V0 tags: - generated_from_trainer - trl - sft licence: license --- # Model Card for Llama-3.2-3B-Instruct-thinking-function_calling-V0 This model is a fine-tuned version of [meta-llama/Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct). It has been trained using [TRL](https://github.com/huggingface/trl). ## Quick start ```python from transformers import pipeline prompt="""human You are a function calling AI model. You are provided with function signatures within 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: [{'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']}}} {'type': 'function', 'function': {'name': 'send_email', 'description': 'Send an email to a customer', 'parameters': {'type': 'object', 'properties': {'customer': {'type': 'string', 'description': 'The customer to send the email to'}, 'subject': {'type': 'string', 'description': 'The subject of the email'}, 'body': {'type': 'string', 'description': 'The body of the email'}}, 'required': ['customer', 'subject', 'body']}}} ] 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 XML tags as follows: {tool_call} Also, before making a call to a function take the time to plan the function to take. Make that thinking process between {your thoughts} Hi, I need you to tell John@doe.com that I received his package ? model """ generator = pipeline("text-generation", model="Cotum/Llama-3.2-3B-Instruct-thinking-function_calling-V0", device="cuda") output = generator([{"role": "user", "content": prompt}], max_new_tokens=500, return_full_text=False)[0] print(output["generated_text"]) ``` ## Training procedure This model was trained with SFT following the Bonus Unit 1 of the Agent Course of Hugging Face : https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb ### Framework versions - TRL: 0.15.1 - Transformers: 4.49.0 - Pytorch: 2.6.0 - Datasets: 3.3.2 - Tokenizers: 0.21.0 ## Citations Cite TRL as: ```bibtex @misc{vonwerra2022trl, title = {{TRL: Transformer Reinforcement Learning}}, author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec}, year = 2020, journal = {GitHub repository}, publisher = {GitHub}, howpublished = {\url{https://github.com/huggingface/trl}} } ```