langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
51.12k stars 7.36k forks source link

BUG: ollama multimodal models don't support parallel requests yet #8531

Open AAEE86 opened 1 month ago

AAEE86 commented 1 month ago

Self Checks

Dify version

0.8.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

ollama log:

time=2024-09-18T09:52:53.395Z level=WARN source=sched.go:137 msg="multimodal models don't support parallel requests yet"

Dify :

Query or prefix prompt is too long, you can reduce the prefix prompt, or shrink the max token, or switch to a llm with a larger token limit size.

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dosubot[bot] commented 1 month ago

I found some similar discussions and issues that might be relevant to your report:

  1. Adding a local ollama model error - This discussion is still open and was last updated on September 12, 2024 [1].
  2. An error occurred during credentials validation - This discussion is still open and was last updated on September 4, 2024 [2].
  3. May I ask, is the issue I mentioned a bug? How can it be resolved? - This discussion is still open and was last updated on April 24, 2024 [3].

Additionally, there was a closed issue related to parallelism:

For handling parallel requests, you can adjust the configuration options in Dify:

These settings can help manage parallel processing more efficiently [5].

For the 'Query or prefix prompt is too long' error, consider the following optimizations:

  1. Reduce the prefix prompt length.
  2. Adjust the max_tokens parameter to a smaller value.
  3. Use a model with a larger token limit, such as GPT-4.
  4. Optimize the prompt structure by separating context, pre-prompt, history, and query [6][7][8][9].

Regarding the current state of multimodal model support, Dify supports ASR models and rich-text models up to GPT-4 specifications. The documentation lists various model providers and their supported capabilities, including speech-to-text and text-to-speech functionalities [10][11].

To continue talking to Dosu, mention @dosu.

AAEE86 commented 1 month ago

@dosu Uploading pictures using a URL will prompt another error. [ollama] Error: API request failed with status code 400: {"error":"illegal base64 data at input byte 5"}

free-cx commented 1 month ago

Pull the code from the main branch again and set the context token size larger, such as 128k.

Note: Webp is not supported.

dosubot[bot] commented 1 month ago

To resolve the "illegal base64 data at input byte 5" error when uploading pictures using a URL in Ollama, ensure that the base64 data is correctly formatted. The base64 string should not contain any invalid characters or whitespace. Here is an example of how to correctly format and use base64 data for an image:

data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAABMCAYAAADDYoEWAAAMQGlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkEBoAQSkhN4EkRpASggt9I4gKiEJEEqMgaBiRxcVXLuIgA1dFVGwAmJBETuLYu+LBRVlXSzYlTcpoOu+8r35vrnz33/O/OfMmbllAFA7zhGJclF1APKEBeLYYH/6uOQUOukpIAEdoAy0gA2Hmy9iRkeHA1iG2r+Xd9cBIm2v2Eu1/tn/X4sGj5/PBQCJhjidl8/Ng/gAAHg1VyQuAIAo5c2mFoikGFagJYYBQrxIijPluFqK0+V4j8wmPpYFcTsASiocjjgTANVLkKcXcjOhhmo/xI5CnkAIgBodYp+8vMk8iNMgtoY2Ioil+oz0H3Qy/6aZPqzJ4WQOY/lcZEUpQJAvyuVM/z/T8b9LXq5kyIclrCpZ4pBY6Zxh3m7mTA6TYhWI+4TpkVEQa0L8QcCT2UOMUrIkIQlye9SAm8+COYMrDVBHHicgDGIDiIOEuZHhCj49QxDEhhjuEHSaoIAdD7EuxIv4+YFxCptN4smxCl9oY4aYxVTwZzlimV+pr/uSnASmQv91Fp+t0MdUi7LikyCmQGxeKEiMhFgVYof8nLgwhc3YoixW5JCNWBIrjd8c4li+MNhfro8VZoiDYhX2pXn5Q/PFNmUJ2JEKvK8gKz5Enh+sncuRxQ/ngl3iC5kJQzr8/HHhQ3Ph8QMC5XPHnvGFCXEKnQ+iAv9Y+VicIsqNVtjjpvzcYClvCrFLfmGcYiyeWAA3pFwfzxAVRMfL48SLsjmh0fJ48OUgHLBAAKADCazpYDLIBoLOvqY+eCfvCQIcIAaZgA/sFczQiCRZjxBe40AR+BMiPsgfHucv6+WDQsh/HWblV3uQIestlI3IAU8gzgNhIBfeS2SjhMPeEsFjyAj+4Z0DKxfGmwurtP/f80Psd4YJmXAFIxnySFcbsiQGEgOII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Cl4lR2SvTH7fU5Uzvacwdyk3IY8pby0vENCTWGOsH2y0eRpk7tEdqISUfcUzylrpvSLw8Tb8pH8CfnNBVrwR75DYi35RfKg0KewqvDD1MSp+6dpTBNO65huO33x9KdFQUW/zcBncGe0zTSZOW/mg1nMWZtnI7PTZ7fNMZuzYE7P3OC5O+ZR5uXM+73YsXhl8dv5SfNbFhgumLvg0S/Bv9SVqJaIS24s9Fq4cRG+SLCoc7Hz4nWLv5XySs+XOZaVl31Zwl1y/tcxv1b8Org0Y2nnMrdlG5YTlwuXX1/hu2LHSo2VRSsfrYpY1biavrp09ds1k9acK3cp37iWslaytrsivKJ5nfm65eu+VGZVXqvyr2qoNqheXP1+PW/95Q1+G+o3Gm4s2/hpk2DTzc3BmxtrLGvKtxC3FG55sjVx65nfGL/VbtPfVrbt63bh9u4dsTvaa91ra3ca7FxWh9ZJ6np3pe66tDtgd3O9ff3mBp2Gsj1gj2TP871pe6/vC9vXtp+xv/6AxYHqg7SDpY1I4/TG/qaspu7m5OauQ6GH2lq8Wg4edji8/YjJkaqj2keXHaMcW3BssLWodeC46HjficwTj9omtd05Oe7k1faY9s5TYafOng46ffIM80zrWe+zR855njt0nnG+6YLbhcYO146Dv7v+frDTrbPxovvF5ksel1q6xnYdu+x7+cSVgCunr7KvXrgWea3resL1mzdSb3Tf5N18div31qvbhbc/35l7l3C39J76vfL7Bvdr/rD5o6Hbrfvog4AHHQ/jHt55xH304nH+4y89C55Qn5Q/NX5a+8zp2ZHeoN5Lz8c/73khevG5r+RPjT+rX1q/PPCX318d/eP6e16JXw2+XvJG7832ty5v2waiB+6/y3v3+X3pB70POz4yPp75lPTp6eepX0h"

Ensure that the base64 string is properly encoded and does not contain any extraneous characters or whitespace. This should resolve the "illegal base64 data at input byte 5" error [1].

To continue talking to Dosu, mention @dosu.