import torchfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModel BASE_MODEL_ID = "Qwen/Qwen2.5-1.5B-Instruct"LORA_REPO_ID = "samarthruckstar/qwen-whatsapp-agent" tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_ID)base_model = AutoModelForCausalLM.from_pretrained( BASE_MODEL_ID, torch_dtype=torch.bfloat16, device_map="auto")model = PeftModel.from_pretrained(base_model, LORA_REPO_ID)model.eval() prompt = "What is the price, power, and capacity of H-ASM15T Automatic Slipper Making Machine?"messages = [ {"role": "system", "content": "You are the official WhatsApp AI assistant for Mahadyuti Engineering Solution."}, {"role": "user", "content": prompt}] inputs = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt").to(model.device)outputs = model.generate(inputs, max_new_tokens=256, do_sample=False)print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))