from transformers import AutoModelForImageTextToText, AutoProcessor
from PIL import Image
processor = AutoProcessor.from_pretrained("Unkuk/k-tour-qwen3vl-8b-v2")
model = AutoModelForImageTextToText.from_pretrained(
"Unkuk/k-tour-qwen3vl-8b-v2",
device_map="auto", torch_dtype="bfloat16",
)
img = Image.open("jeju.jpg").convert("RGB")
msgs = [{"role": "user", "content": [
{"type": "image", "image": img},
{"type": "text", "text": "여기 가족이랑 가볼 만한가요?"},
]}]
text = processor.apply_chat_template(msgs, add_generation_prompt=True, tokenize=False)
inputs = processor(text=[text], images=[img], return_tensors="pt").to("cuda")
out = model.generate(**inputs, max_new_tokens=256)
print(processor.batch_decode(out, skip_special_tokens=True)[0])