from peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer base_id = "Qwen/Qwen2.5-0.5B-Instruct"adapter_id = "tayyib-sayyid/qwen2.5-0.5b-gsm8k-lora" tok = AutoTokenizer.from_pretrained(adapter_id)base = AutoModelForCausalLM.from_pretrained(base_id, device_map="auto")model = PeftModel.from_pretrained(base, adapter_id)model.eval() prompt = ( "Natalia sold clips to 48 of her friends in April, and then she sold " "half as many clips in May. How many clips did Natalia sell altogether " "in April and May?")messages = [{"role": "user", "content": prompt}]inputs = tok.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)out = model.generate(inputs, max_new_tokens=256, do_sample=False)print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))