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

feat: support Llama3 models on Bedrock #7581

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion haystack/nodes/prompt/invocation_layer/amazon_bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class AmazonBedrockInvocationLayer(AWSBaseInvocationLayer):
r"ai21.j2.*": AI21LabsJurassic2Adapter,
r"cohere.command.*": CohereCommandAdapter,
r"anthropic.claude.*": AnthropicClaudeAdapter,
r"meta.llama2.*": MetaLlama2ChatAdapter,
r"meta.llama.*": MetaLlama2ChatAdapter,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this . here before *?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's a regex match all char. Bit ugly because of the other dots, but we also added tests.

r"mistral.mi[sx]tral.*": MistralAIAdapter, # codespell:ignore tral
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
enhancements:
- |
Support for Llama3 models on AWS Bedrock.
3 changes: 3 additions & 0 deletions test/prompt/invocation_layer/test_amazon_bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ def test_supports_with_stream_true_for_model_that_does_not_support_streaming():
("meta.llama2-13b-chat-v1", MetaLlama2ChatAdapter),
("meta.llama2-70b-chat-v1", MetaLlama2ChatAdapter),
("meta.llama2-130b-v5", MetaLlama2ChatAdapter), # artificial
("meta.llama3-8b-instruct-v1:0", MetaLlama2ChatAdapter),
("meta.llama3-70b-instruct-v1:0", MetaLlama2ChatAdapter),
("meta.llama3-130b-instruct-v5:9", MetaLlama2ChatAdapter), # artificial
("mistral.mistral-7b-instruct-v0:2", MistralAIAdapter),
("mistral.mixtral-8x7b-instruct-v0:1", MistralAIAdapter),
("mistral.mistral-large-2402-v1:0", MistralAIAdapter),
Expand Down
Loading