Skip to content

Commit

Permalink
Revert "Fix compatibility with region inference (#531)"
Browse files Browse the repository at this point in the history
This reverts commit 34228f0.
  • Loading branch information
statefb committed Sep 17, 2024
1 parent 34228f0 commit 4bd7526
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions backend/app/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,18 @@ def calculate_price(

def get_model_id(model: type_model_name) -> str:
# Ref: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids-arns.html
region = BEDROCK_REGION.split("-")[0] # Cross-region inference
if model == "claude-v2":
return "anthropic.claude-v2:1"
elif model == "claude-instant-v1":
return "anthropic.claude-instant-v1"
elif model == "claude-v3-sonnet":
return f"{region}.anthropic.claude-3-sonnet-20240229-v1:0"
return "anthropic.claude-3-sonnet-20240229-v1:0"
elif model == "claude-v3-haiku":
return f"{region}.anthropic.claude-3-haiku-20240307-v1:0"
return "anthropic.claude-3-haiku-20240307-v1:0"
elif model == "claude-v3-opus":
return f"{region}.anthropic.claude-3-opus-20240229-v1:0"
return "anthropic.claude-3-opus-20240229-v1:0"
elif model == "claude-v3.5-sonnet":
return f"{region}.anthropic.claude-3-5-sonnet-20240620-v1:0"
return "anthropic.claude-3-5-sonnet-20240620-v1:0"
elif model == "mistral-7b-instruct":
return "mistral.mistral-7b-instruct-v0:2"
elif model == "mixtral-8x7b-instruct":
Expand Down

0 comments on commit 4bd7526

Please sign in to comment.