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