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 · 3 comments
Open
1 task
Assignees
Labels
bedrock bedrock-runtime bug This issue is a confirmed bug. p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.

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

@khushail khushail self-assigned this Feb 3, 2025
@khushail khushail added p2 This is a standard priority issue bedrock-runtime bedrock needs-reproduction investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. needs-reproduction labels Feb 3, 2025
@khushail
Copy link

khushail commented Feb 6, 2025

Hi @reciprocal-space , thanks for reporting this issue. I am able to reproduce the same. I also tried running it through Bedrock playground in Console and got the same error. Looks like an issue on Bedrock API. Will file an issue with them and share updates on the progress of the resolution.

@khushail khushail added service-api This issue is caused by the service API, not the SDK implementation. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Feb 6, 2025
@khushail
Copy link

khushail commented Feb 7, 2025

Internal ticket : P198697821

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bedrock bedrock-runtime bug This issue is a confirmed bug. p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants