from peft import PeftModelfrom transformers import AutoProcessor, Qwen3VLForConditionalGeneration PREFIX = """TASK: Rewrite the explanation below in plain everyday language so anon-expert immediately understands why the image looks fake. Use oneor two short sentences, no more than ~35 words. Keep the single mostimportant visual reason and the main object it refers to. Do notintroduce new facts. Avoid technical vocabulary such as "artifact","synthesis", "inconsistency", "generation", "synthetic", or"anatomical". Explanation:""" model = Qwen3VLForConditionalGeneration.from_pretrained( "Qwen/Qwen3-VL-8B-Instruct", torch_dtype="bfloat16", device_map="auto")model = PeftModel.from_pretrained(model, "theluka2/xplainverse-qwen3vl-compressor-grpo")processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-8B-Instruct") complex_text = "..." # from Pass-2messages = [{"role": "user", "content": PREFIX + complex_text}]inputs = processor.apply_chat_template( messages, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt",).to(model.device)out = model.generate(**inputs, max_new_tokens=80)print(processor.batch_decode(out, skip_special_tokens=True)[0])