update readme

This commit is contained in:
Hongji Zhu
2024-02-02 15:48:35 +08:00
parent 3194a8921a
commit 2157f5d97a
4 changed files with 9 additions and 9 deletions

View File

@@ -177,17 +177,17 @@ if __name__ == '__main__':
model_path = 'openbmb/OmniLMM-12B'
chat_model = OmniLMMChat(model_path)
im_64 = img2base64('./assets/COCO_test2015_000000262144.jpg')
im_64 = img2base64('./assets/worldmap_ck.jpg')
# first round chat
msgs = [{"role": "user", "content": "What are the people doing?"}]
msgs = [{"role": "user", "content": "What is interesting about this image?"}]
input = {"image": im_64, "question": json.dumps(msgs, ensure_ascii=True)}
answer = chat_model.chat(input)
print(msgs[-1]["content"]+'\n', answer)
# second round chat
msgs.append({"role": "assistant", "content": answer})
msgs.append({"role": "user", "content": "Describe the image"})
msgs.append({"role": "user", "content": "Where is China in the image"})
input = {"image": im_64,"question": json.dumps(msgs, ensure_ascii=True)}
answer = chat_model.chat(input)
print(msgs[-1]["content"]+'\n', answer)