from transformers import AutoModelForCausalLM, AutoTokenizerimport torch model_id = "narcolepticchicken/qwen2.5-7b-verifier"tok = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="cuda") SYSTEM = ("You are a strict verifier. Decide whether the candidate response " "satisfies the given criterion. Write a short critique, then output " "exactly 'Verdict: PASS' or 'Verdict: FAIL'.")user = ("Task: ...\nCriterion: ...\nScore-5 description: ...\nScore-1 description: ...\n" "Reference answer: ...\nCandidate response: ...")msgs = [{"role": "system", "content": SYSTEM}, {"role": "user", "content": user}]ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to("cuda")out = model.generate(ids, max_new_tokens=512, do_sample=False)print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))