from transformers import AutoModelForImageTextToText, AutoProcessor model_id = "Shayannasiri/MedFrame-R1-8B-SFT"model = AutoModelForImageTextToText.from_pretrained(model_id, torch_dtype="auto", device_map="auto")processor = AutoProcessor.from_pretrained(model_id) messages = [{"role": "user", "content": [ {"type": "image", "image": "image.png"}, {"type": "text", "text": "Is there evidence of pneumothorax?"},]}]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=1024)print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))