From e89beb634314710d04ae4be5b6139c964b82147b Mon Sep 17 00:00:00 2001 From: Sanjiv Das Date: Wed, 8 May 2024 10:51:11 -0700 Subject: [PATCH 1/2] Add Titan embeddning model v2 Included the new embedding model, released recently on Amazon Bedrock. --- .../jupyter_ai_magics/embedding_providers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/embedding_providers.py b/packages/jupyter-ai-magics/jupyter_ai_magics/embedding_providers.py index 3b187e1c2..7fa5372d6 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/embedding_providers.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/embedding_providers.py @@ -98,10 +98,14 @@ class HfHubEmbeddingsProvider(BaseEmbeddingsProvider, HuggingFaceHubEmbeddings): registry = True +# See model ID list here: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html class BedrockEmbeddingsProvider(BaseEmbeddingsProvider, BedrockEmbeddings): id = "bedrock" name = "Bedrock" - models = ["amazon.titan-embed-text-v1"] + models = [ + "amazon.titan-embed-text-v1", + "amazon.titan-embed-text-v2:0" + ] model_id_key = "model_id" pypi_package_deps = ["boto3"] auth_strategy = AwsAuthStrategy() From cbcfc34b59fc7b1949bafd9cbbc9d9137345f930 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 17:55:14 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../jupyter_ai_magics/embedding_providers.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/embedding_providers.py b/packages/jupyter-ai-magics/jupyter_ai_magics/embedding_providers.py index 7fa5372d6..3dea152e7 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/embedding_providers.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/embedding_providers.py @@ -102,10 +102,7 @@ class HfHubEmbeddingsProvider(BaseEmbeddingsProvider, HuggingFaceHubEmbeddings): class BedrockEmbeddingsProvider(BaseEmbeddingsProvider, BedrockEmbeddings): id = "bedrock" name = "Bedrock" - models = [ - "amazon.titan-embed-text-v1", - "amazon.titan-embed-text-v2:0" - ] + models = ["amazon.titan-embed-text-v1", "amazon.titan-embed-text-v2:0"] model_id_key = "model_id" pypi_package_deps = ["boto3"] auth_strategy = AwsAuthStrategy()