import jsonfrom transformers import AutoModelForCausalLM, AutoTokenizertok = AutoTokenizer.from_pretrained("sovthpaw/omnistep-new")model = AutoModelForCausalLM.from_pretrained("sovthpaw/omnistep-new", device_map="auto", torch_dtype="bfloat16") tools = [{ "name": "get_weather", "description": "Get current weather for a city", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}]msgs = [{"role": "user", "content": "What's the weather in Tokyo?"}]prompt = tok.apply_chat_template(msgs, tools=tools, add_generation_prompt=True, tokenize=False)out = model.generate(**tok(prompt, return_tensors="pt").to("cuda"), max_new_tokens=200)print(tok.decode(out[0][len(tok.encode(prompt)):]))# → <tool_call>{"name": "get_weather", "arguments": {"city": "Tokyo"}}</tool_call>