Skip to content
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

Validation Exception when using images with llama-3.2 on Bedrock #4415

Open
1 task
reciprocal-space opened this issue Jan 29, 2025 · 1 comment
Open
1 task
Labels
bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged.

Comments

@reciprocal-space
Copy link

reciprocal-space commented Jan 29, 2025

Describe the bug

We have been using the converse operation on bedrock with us.meta.llama3-2-11b-instruct-v1:0 and image inputs but as of this past Monday the operation has begun failing.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

We expect to receive back a successful response with the information required by our prompt.

Current Behavior

We receive the following error response:

An error occurred (ValidationException) when calling the Converse operation: The model returned the following errors: The provided image does not match the specified image format.

Reproduction Steps

# Python v3.8.12, boto 1.34.152

file_obj = s3.get_object(Bucket=bucket, Key=key)
image_content = file_obj['Body'].read()

"messages": [
    {
        "content": [
            {"text": prompt},
            {"image": {"format": "jpeg", "source": {"bytes": image_content}}}
        ],
        "role": "user"
    }
]

response = bedrock_runtime.converse(
    modelId='us.meta.llama3-2-11b-instruct-v1:0',
    messages=messages,
    inferenceConfig={
        "maxTokens": kwargs.get('max_tokens', 100),
        "temperature": kwargs.get('temperature', .5),
        "topP": kwargs.get('topP', 0.9),
    }
)

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.34.152

Environment details (OS name and version, etc.)

Docker, python:3.8.12-buster image

@reciprocal-space reciprocal-space added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Jan 29, 2025
@reciprocal-space
Copy link
Author

looks like this issue only happens when the supplied image is a jpeg - if the input is converted to a png the converse operation works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant