from transformers import AutoModelForCausalLM, AutoTokenizer repo = "Rumiii/Qwen3-8B-Maxima_A1"tok = AutoTokenizer.from_pretrained(repo)model = AutoModelForCausalLM.from_pretrained(repo, dtype="auto", device_map="auto") tools = [{ "type": "function", "function": { "name": "get_weather", "description": "Get the current weather for a city.", "parameters": { "type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"], }, },}] messages = [{"role": "user", "content": "What's the weather in Hyderabad?"}]prompt = tok.apply_chat_template(messages, tools=tools, tokenize=False, add_generation_prompt=True)inputs = tok(prompt, return_tensors="pt").to(model.device) out = model.generate(**inputs, max_new_tokens=256, do_sample=False)print(tok.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=False).split("<|im_end|>")[0])