OpenBMB / MiniCPM-V

MiniCPM-Llama3-V 2.5: A GPT-4V Level Multimodal LLM on Your Phone
Apache License 2.0
7.82k stars 543 forks source link

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

Closed pdwfree closed 2 weeks ago

pdwfree commented 2 weeks ago

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

该问题是否在FAQ中有解答? | Is there an existing answer for this in 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 ```Markdown - OS:windows10 - Python:3.11 - Transformers:4.40 - PyTorch:2.12 - CUDA (`python -c 'import torch; print(torch.version.cuda)'`): ``` ### 备注 | Anything else? _No response_
iceflame89 commented 2 weeks ago

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

pdwfree commented 2 weeks ago

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

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

iceflame89 commented 2 weeks ago

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