from transformers import AutoTokenizer, AutoModelForCausalLM repo_id = "YOUR_USERNAME/echo-functiongemma-270m"tokenizer = AutoTokenizer.from_pretrained(repo_id)model = AutoModelForCausalLM.from_pretrained(repo_id, torch_dtype="auto") tools = [ { "type": "function", "function": { "name": "volume_manager", "description": "Adjusts host master audio volume or toggles mute status.", "parameters": { "type": "object", "properties": { "action": {"type": "string", "description": "Volume action: 'set', 'mute', 'unmute', 'increase', 'decrease'."}, "level": {"type": "integer", "description": "Integer audio level between 0 and 100."}, }, "required": ["action"], }, }, }, # Add the other tools from the table above as needed.] messages = [ {"role": "developer", "content": "Current date and time given in YYYY-MM-DDTHH:MM:SS format: 2026-10-18T09:30:00\nDay of week is Sunday\nYou are a model that can do function calling with the following functions\n"}, {"role": "user", "content": "Lower the sound to 20 percent"},] inputs = tokenizer.apply_chat_template(messages, tools=tools, add_generation_prompt=True, return_tensors="pt", return_dict=True)output = model.generate(**inputs, max_new_tokens=128)print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=False))