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
42.53k stars 5.87k forks source link

Use ollama model "moondream" to do a vision predition , dify returns an error :<DETAIL.LOW: 'low'>)] is not valid #6247

Open nne998 opened 1 month ago

nne998 commented 1 month ago

Self Checks

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Use ollama model "moondream" to do a vision predition , dify got this error :

<DETAIL.LOW: 'low'>)] is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers.

2. Additional context or comments

model url : https://ollama.com/library/moondream

DSL file : moondream_1.8b_test.yml.zip

3. Can you help us with this feature?

dosubot[bot] commented 1 month ago

The error you're encountering suggests that the input format for the "moondream" model's vision prediction is incorrect. Specifically, the value for <DETAIL.LOW: 'low'> should be a string, a list/tuple of strings, or a list/tuple of integers.

To resolve this, ensure that your input adheres to the required format for vision predictions. The "moondream" model requires images as input, which can be uploaded either locally or via URL. Additionally, the model can operate in both high and low resolution modes. Here is an example of how to structure your input:

{
  "function_call": {
    "name": "vision_prediction",
    "arguments": {
      "image": "URL_or_local_path_to_image",
      "resolution": "low"  // or "high"
    }
  }
}

Make sure to replace "URL_or_local_path_to_image" with the actual path or URL of your image and set the "resolution" to either "low" or "high" as required.

If the error persists, double-check the documentation for any additional input format requirements specific to the "moondream" model [1].

To continue talking to Dosu, mention @dosu.

nne998 commented 1 month ago

F**K the dosu bot 👎 ?

crazywoola commented 1 month ago

Please be kind to the bot.