from transformers import AutoModelForImageTextToText, AutoProcessorfrom PIL import Image model = AutoModelForImageTextToText.from_pretrained( "wkinglin/HalluScope-8B", torch_dtype="auto", device_map="auto")processor = AutoProcessor.from_pretrained("wkinglin/HalluScope-8B") messages = [{ "role": "user", "content": [ {"type": "image", "image": Image.open("example.jpg")}, {"type": "text", "text": "Analyze the response and tag hallucinated spans:\n<response to diagnose>"}, ],}]inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt",).to(model.device)out = model.generate(**inputs, max_new_tokens=2048)print(processor.batch_decode(out, skip_special_tokens=True)[0])