Closed saket424 closed 1 month ago
It does seem to have incorrect padding as indicated, base64.b64decode() is successful if you add an '=' to the end, which adds padding.
base64.b64decode('iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII=')
If you're sure about this please share the original image so we can compare the encoding method.
Thanks the trailing = fixed the issue Now openedai-vision works with this small base64 encoded image in a nodered flow. thank you
{"id":"chatcmpl-1721141417","object":"chat.completion","created":1721141417,"model":"moondream2","system_fingerprint":"fp_111111111","choices":[{"index":0,"message":{"role":"assistant","content":" The image features a white background with four distinct gray squares. The squares are arranged in a square grid pattern, creating a visually appealing and symmetrical design. The gray squares are slightly darker than the white background, adding depth and contrast to the overall composition. The image does not contain any text or additional objects, and the relative positions of the squares remain constant throughout the image."},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
Same image works fine when using LM Studio but results in a 500 error in openedai-vision
Input
Output from LM Studio {"id":"chatcmpl-m6h6759cqvl7mby9i1gz","object":"chat.completion","created":1720801907,"model":"moondream/moondream2-gguf/moondream2-text-model-f16.gguf","choices":[{"index":0,"message":{"role":"assistant","content":"In this image, there are four squares of varying sizes, all rendered in shades of gray and white. They appear to be placed side by side with some distance between them, creating a sense of depth and space within the design. The colors used for each square range from pure black to more muted tones, adding contrast and visual interest to the overall composition. This image seems to be a digital illustration or an artistic representation of an abstract pattern that could potentially be used in various mediums such as graphic design or interior decorating."},"finish_reason":"stop"}],"usage":{"prompt_tokens":42,"completion_tokens":105,"total_tokens":147}}
Output from openedai-vision