-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using the Qwen2-VL-72B-Instruct model from siliconCloud to enable visual functions, an error occurred while calling the API. #14245
Comments
Hey, @xinshenghao! I'm here to help you with bugs, questions, and contributions. Let's tackle this issue together! I found a similar discussion that might be relevant to your issue: I can't upload the image on dify workflow via api, which is still open and unsolved [1]. Regarding the error you're encountering, it seems to be related to the format of the image input. The error message indicates that the image URL should be a valid URL or in the format Make sure that your image input is correctly formatted according to these specifications to resolve the error. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
@dosu MULTIMODAL_SEND_IMAGE_FORMAT is base64 |
Great! Since your If the format is correct and the issue persists, verify that the base64 string is complete and not truncated. You might also want to test with a different image to rule out any issues with the specific file you're using. If you continue to face issues, consider logging the base64 string to ensure it's being generated and sent correctly. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
@dosu I added print statements in the LLM plugin source code and found that the base64 data content of the image was abnormal. The data sent to SiliconCloud is as follows:
How can I fix it? |
It looks like the base64 image data is incomplete in the JSON payload you're sending. The To fix this, ensure that the base64 string is correctly generated and appended to the
Here's a simple example of how you might encode an image to base64 in Python: import base64
# Read the image file
with open('path_to_image.png', 'rb') as image_file:
# Encode the image to base64
base64_image = base64.b64encode(image_file.read()).decode('utf-8')
# Construct the full data URL
image_data_url = f"data:image/png;base64,{base64_image}" Ensure that To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
@dosu I added a print statement in the /api/core/plugin/manager/modle.py(method:invoke_llm line:145) file of the dify-api and found that the base64 image data sent to the plugin module is complete. I speculate that there might be an issue with the plugin module. |
Hey @xinshenghao! It sounds like you're diving deep into the code, which is awesome! However, I'm just a bot designed to help with bugs, technical questions, and engineering knowledge. I can't really speculate on issues with specific plugin modules. If you think I should be able to help with this, feel free to reach out to the Dosu Team. They'll be happy to hear your feedback! To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
@dosu I find a console in docker-api-1: |
The warnings you're encountering indicate that Pydantic is expecting a To resolve these warnings, ensure that the data being serialized matches the expected types. Here are some steps you can take:
By aligning the data types with the expected model definitions, you should be able to resolve these warnings and ensure that the serialization process works as intended. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
view #14326 |
Self Checks
Dify version
1.0.0-beta.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I have a simple workflow.
Step 1: Upload the image and name it "file".
Step 2: Call the model to perform the analysis.
error is:
✔️ Expected Behavior
fix it
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: