from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("/data", trust_remote_code=True)
model = AutoModel.from_pretrained("/data/", trust_remote_code=True).half().cuda()
image_path = "/data/000000546717.jpg"
response, history = model.chat(tokenizer, image_path, "描述这张图片。", history=[])
print(response)
response, history = model.chat(tokenizer, image_path, "这张图片可能是在什么场所拍摄的？", history=history)
print(response)
