OpenBMB / MiniCPM-V

MiniCPM-Llama3-V 2.5: A GPT-4V Level Multimodal LLM on Your Phone

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: MiniCPMV.chat() missing 1 required positional argument: 'context'[BUG] <title>

pdwfree opened this issue · comments

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

  • 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

  • 我已经搜索过FAQ | I have searched FAQ

当前行为 | Current Behavior

L:\MiniCPM-V-main>WPy64-31110\python-3.11.1.amd64\python web_demo_2.5.py
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:02<00:00, 1.44s/it]
Running on local URL: http://0.0.0.0:8080

To create a public link, set share=True in launch().
: 分析这张图片
MiniCPMV.chat() missing 1 required positional argument: 'context'
Traceback (most recent call last):
File "L:\MiniCPM-V-main\web_demo_2.5.py", line 142, in chat
answer = model.chat(
^^^^^^^^^^^
TypeError: MiniCPMV.chat() missing 1 required positional argument: 'context'
: Error, please retry
: how about this picture
MiniCPMV.chat() missing 1 required positional argument: 'context'
Traceback (most recent call last):
File "L:\MiniCPM-V-main\web_demo_2.5.py", line 142, in chat
answer = model.chat(
^^^^^^^^^^^
TypeError: MiniCPMV.chat() missing 1 required positional argument: 'context'
: Error, please retry

上传图片后问问题报错。

期望行为 | Expected Behavior

No response

复现方法 | Steps To Reproduce

No response

运行环境 | Environment

- OS:windows10
- Python:3.11
- Transformers:4.40
- PyTorch:2.12
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

No response

请确保模型名称为openbmb/MiniCPM-Llama3-V-2_5,如果使用的本地路径,检查是否是下载的最新版

请确保模型名称为openbmb/MiniCPM-Llama3-V-2_5,如果使用的本地路径,检查是否是下载的最新版

本地路径肯定是对的,要不然也不会加载checkpoints shards成功?在魔搭社区下载的,所以是模型的版本不对?

很可能你用的模型不是MiniCPM-Llama3-V-2_5
TypeError: MiniCPMV.chat() missing 1 required positional argument: 'context'
MiniCPM-V-2里才会需要context参数,请再仔细检查