OpenBMB / ollama

Get up and running with Llama 3, Mistral, Gemma, and other large language models.
https://ollama.com
MIT License
11 stars 5 forks source link

如何往Prompt里加入图片? #1

Closed Aues6uen11Z closed 1 month ago

Aues6uen11Z commented 1 month ago

首先非常感谢你们的工作

我还是有些不清楚如何用Ollama部署使用这个模型,按照README正常运行模型后,我模仿Ollama的多模态模型对话写法进行图片提问,但MiniCPMV2.5似乎没有正确接收图片。 环境:Win10,Ollama 0.1.38

image

使用Open WebUI上传图片也是同样结果 image

Modelfile除了模型路径都没改,也没有做其他设置,可能和其他多模态模型的输入方式不太兼容?希望在这里能有更清晰的指引,非常感谢!

kotaxyz commented 1 month ago

same issue here

Aues6uen11Z commented 1 month ago

不好意思,我把前面构建过程给跳过了,直接用的ollama的发布包。。。 不过后面在构建的时候因为缺少ollama/llm/patches报错了,同样Win10

tc-mb commented 1 month ago

首先非常感谢你们的工作

我还是有些不清楚如何用Ollama部署使用这个模型,按照README正常运行模型后,我模仿Ollama的多模态模型对话写法进行图片提问,但MiniCPMV2.5似乎没有正确接收图片。 环境:Win10,Ollama 0.1.38

image

使用Open WebUI上传图片也是同样结果 image

Modelfile除了模型路径都没改,也没有做其他设置,可能和其他多模态模型的输入方式不太兼容?希望在这里能有更清晰的指引,非常感谢!

因为我们模型暂时不被官方支持,所以如果你的代码中ollama和llama.cpp不是我们的版本,会导致vit部分加载失败,ollama run可以运行通过,但图像特征是没有处理的,意味着模型看不到输入的图片。

为了尽快让开源社区能够使用,我们临时fork出来一份代码来支持MiniCPM-V2.5。ollama是基于llama.cpp上面做的封装,而我们也同样fork了一份llama.cpp的版本用来支持MiniCPM-V2.5。我们会尽快将我们的模型合入llama.cpp和ollama的官方。

目前使用需要支持MiniCPM-V2.5的版本的ollama和llama.cpp才可以,并且确认分支正确性。在文档最前面是说明了clone具体哪个分支。

或许以上信息可以帮到你,如果有其他问题可以继续给我讲,我会尽快回复。

tc-mb commented 1 month ago

same issue here

Because our model is not officially supported now, if ollama and llama.cpp in your code are not our fork, it will cause partial loading of vit to fail, and "ollama run" can run through, but the image features are not processed, which means that the model can not see the input image.

In order to make it available to the open source community ASAP, we temporarily fork ollama to support MiniCPM-V2.5. Ollama is based on the llama.cpp, and we also have a fork of llama.cpp. We will merge our model into the official llama.cpp and ollama ASAP.

Currently, you can only use ollama and llama.cpp versions that support MiniCPM-V2.5, and confirm that the branches are correct. At the top of the document is the specific branch of the clone.

Perhaps the above information can help you, feel free to reply.

tc-mb commented 1 month ago

不好意思,我把前面构建过程给跳过了,直接用的ollama的发布包。。。 不过后面在构建的时候因为缺少ollama/llm/patches报错了,同样Win10

我猜可能是你使用的分支还是主分支,或许值得确认一下是否使用的是minicpm-v2.5的子分支。

git clone -b minicpm-v2.5 https://github.com/OpenBMB/ollama.git
cd ollama/llm
git clone -b minicpm-v2.5_for_ollama https://github.com/OpenBMB/llama.cpp.git
Aues6uen11Z commented 1 month ago

用的确实是子分支 image

报错是 image

tc-mb commented 1 month ago

用的确实是子分支 image

报错是 image

抱歉,我的错。 我的一些修改没有同步在window build流程里。 我已经修改了,现在应该可以正常build。 感谢。

Aues6uen11Z commented 1 month ago

抱歉,我的错。 我的一些修改没有同步在window build流程里。 我已经修改了,现在应该可以正常build。 感谢。

辛苦辛苦,之前的问题解决了,但我试了很多版本的cmake gcc构建还是有各种报错,比如

cmake 3.24.4 go 1.22.3 gcc 13.2.0 (x86_64-win32-seh-rev1, Built by MinGW-Builds project) image image image log.txt

不清楚是哪里出了问题,要不我还是等官方合并吧=.=

tc-mb commented 1 month ago

抱歉,我的错。 我的一些修改没有同步在window build流程里。 我已经修改了,现在应该可以正常build。 感谢。

辛苦辛苦,之前的问题解决了,但我试了很多版本的cmake gcc构建还是有各种报错,比如

cmake 3.24.4 go 1.22.3 gcc 13.2.0 (x86_64-win32-seh-rev1, Built by MinGW-Builds project) image image image log.txt

不清楚是哪里出了问题,要不我还是等官方合并吧=.=

嗯嗯,等官方合并也是个好办法。 我们也在继续整理代码准备提PR合到官方分支。