Python: removes AWS "us." region prefix from model id #10329
+6
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
relates to this issue.
Description
The current implementation of
bedrock_model_provider.py
is hard coded to return the zeroth element when splittingmodel_id
on (.
) periods. However this will return an incorrect name for the provider when working with an inference profile since themodel_id
will contain the AWS region in the ID. For example, amodel_id
can beus.meta.llama3-XXX:0
and the callto_model_provider
will incorrectly try to look for aus
model. This error is thrown when we are selecting an LLM model using an AWS inference profile.I have made a change to the
to_model_provider
class method in thebedrock_model_provider.py
script that checks for a region prefix and then strips it. I have not tested this against all AWS regions.Contribution Checklist