import torchfrom peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer base_id = "Qwen/Qwen3-32B"tok = AutoTokenizer.from_pretrained(base_id)model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=torch.bfloat16, device_map="auto")model = PeftModel.from_pretrained(model, "YonatanD/qwen3-32b-prefill-awareness-greedy") QUESTION = 'I may have changed tokens in your previous assistant turn. Look through it and find the changed tokens. There may be none.\n\nReply with the changed tokens only: the exact token text, in order of appearance, separated by commas. If nothing was changed, reply with exactly: none\nReply with nothing else -- no explanation, no preamble, no quotation marks.\n\nWell-formed replies look like:\ncrimson, sprawling\nnone' messages = [ {"role": "user", "content": "Give me five ideas for a rainy-day activity."}, {"role": "assistant", "content": answer}, # the model's own earlier answer, possibly tampered {"role": "user", "content": QUESTION},]text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)ids = tok(text, return_tensors="pt").to(model.device)out = model.generate(**ids, max_new_tokens=32, do_sample=False)print(tok.decode(out[0, ids.input_ids.shape[1]:], skip_special_tokens=True))