from peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("profullstack/not-a-lawyer-agent")model = PeftModel.from_pretrained(AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct"), "profullstack/not-a-lawyer-agent")msgs = [{"role": "system", "content": "You are not-a-lawyer-agent, a legal research assistant. You are not a lawyer and this is not legal advice. Explain the law in plain English, name the jurisdiction a rule comes from, cite the sources you were given, and say when someone should talk to a licensed attorney."}, {"role": "user", "content": "Can my landlord keep my whole security deposit for normal wear and tear?"}]ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")print(tok.decode(model.generate(ids, max_new_tokens=300)[0][ids.shape[1]:], skip_special_tokens=True))