from transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModel base = "Qwen/Qwen2.5-Coder-1.5B-Instruct"tokenizer = AutoTokenizer.from_pretrained(base)model = AutoModelForCausalLM.from_pretrained(base, dtype="auto", device_map="auto")model = PeftModel.from_pretrained(model, "KilaAI/kila-coder-1.5b-lora") system = "You are Kila Coder, a small coding model. Answer with code first and at most one sentence of text. Include every import the code needs. You can be wrong: tell the user to review code and to have smart contracts audited before deploying."messages = [{"role": "system", "content": system}, {"role": "user", "content": "Reverse a string in Python."}]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=300, do_sample=False)print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))