from transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModel # Load base model and LoRA adapterbase_model = AutoModelForCausalLM.from_pretrained( "55mvresearch/Qwen2.5-7B-Instruct-SFT-FT1-Merged", torch_dtype="auto", device_map="auto")model = PeftModel.from_pretrained(base_model, "55mvresearch/Qwen2.5-7B-Instruct-GRPO-Emotion1")tokenizer = AutoTokenizer.from_pretrained("55mvresearch/Qwen2.5-7B-Instruct-GRPO-Emotion1") # Generate emotional admessages = [ {"role": "system", "content": "You are an award-winning creative director. Write emotionally powerful advertisements."}, {"role": "user", "content": "Create an ad for a coffee brand that evokes nostalgia and warmth."}] text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)inputs = tokenizer(text, return_tensors="pt").to(model.device)outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)print(tokenizer.decode(outputs[0], skip_special_tokens=True))