#! /usr/bin/python3.12 # pip3.12 install vllm accelerate from transformers import pipeline nlp=pipeline("image-text-to-text","Qwen/Qwen3-VL-32B-Instruct",max_new_tokens=2048,device_map="auto") for i in range(103,261): img=f"http://kanji.zinbun.kyoto-u.ac.jp/~yasuoka/kyodokenkyu/2025-12-19/matsushima/{i}.jpg" d=nlp([{"role":"user","content":[{"type":"image","image":img},{"type":"text","text":"閱讀垂直文言文,逐行輸出。"}]}]) with open(f"{i}.txt","w",encoding="utf-8") as w: print(d[0]["generated_text"][1]["content"],file=w)