from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "thealper2/qwen3-0.6b-reasoning-sft"tokenizer = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto") messages = [ {"role": "system", "content": "You are a careful, step-by-step reasoner. For each problem, think through it methodically, then give a final answer."}, {"role": "user", "content": "Solve x^2 - 7x + 12 = 0 and verify both roots."},]text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)inputs = tokenizer(text, return_tensors="pt").to(model.device)output = model.generate(**inputs, max_new_tokens=2048)print(tokenizer.decode(output[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))