[BUG] <title>Input Error: Only 4D input Tensors are supported (got 3D)
是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?
- [x] 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions
该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?
- [X] 我已经搜索过FAQ | I have searched FAQ
当前行为 | Current Behavior
我运行多轮对话的测试代码之后 from chat import MiniCPMVChat, img2base64 import torch import json
torch.manual_seed(0)
chat_model = MiniCPMVChat('openbmb/MiniCPM-Llama3-V-2_5')
im_64 = img2base64('./assets/airplane.jpeg')
msgs = [{"role": "user", "content": "Tell me the model of this aircraft."}]
inputs = {"image": im_64, "question": json.dumps(msgs)} answer = chat_model.chat(inputs) print(answer)
msgs.append({"role": "assistant", "content": answer}) msgs.append({"role": "user", "content": "Introduce something about Airbus A380."})
inputs = {"image": im_64, "question": json.dumps(msgs)} answer = chat_model.chat(inputs) print(answer)
出现了下面的错误
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████| 7/7 [00:06<00:00, 1.11it/s]
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Traceback (most recent call last):
File "/data/wzy/LLM/MiniCPM-V-main/test.py", line 54, in
期望行为 | Expected Behavior
No response
复现方法 | Steps To Reproduce
No response
运行环境 | Environment
- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):
备注 | Anything else?
No response
你可以看下你输入的im_64的shape,用于判断是否图片读取除了问题
你可以看下你输入的im_64的形状,用于判断是否图片读取除了问题
我使用的就是README中默认的多轮对话的代码。如果作者可以正常运行的话应该是不会出问题的吧
您好,可以尝试使用我们最新的教程https://huggingface.co/openbmb/MiniCPM-V-2_6#chat-with-multiple-images