From e3f58d354cbcbca587020aaca9eb7b764f97d131 Mon Sep 17 00:00:00 2001 From: billytrend-cohere <144115527+billytrend-cohere@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:33:24 -0500 Subject: [PATCH 1/2] Update client.py --- src/cohere/manually_maintained/cohere_aws/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cohere/manually_maintained/cohere_aws/client.py b/src/cohere/manually_maintained/cohere_aws/client.py index 60addcc7d..3e88d701b 100644 --- a/src/cohere/manually_maintained/cohere_aws/client.py +++ b/src/cohere/manually_maintained/cohere_aws/client.py @@ -39,7 +39,7 @@ def __init__( """ if not AWS_DEPS_AVAILABLE: raise CohereError("AWS dependencies not available. Please install boto3 and sagemaker.") - self._client = boto3.client() + self._client = boto3.client("sagemaker") if os.environ.get('AWS_DEFAULT_REGION') is None: os.environ['AWS_DEFAULT_REGION'] = aws_region self._sess = sage.Session(sagemaker_client=self._service_client) From 718ffeaae64d7eab661afae2f0d3525d7f5241bb Mon Sep 17 00:00:00 2001 From: billytrend-cohere <144115527+billytrend-cohere@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:10:14 -0500 Subject: [PATCH 2/2] Update client.py --- src/cohere/manually_maintained/cohere_aws/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cohere/manually_maintained/cohere_aws/client.py b/src/cohere/manually_maintained/cohere_aws/client.py index 3e88d701b..93be85e87 100644 --- a/src/cohere/manually_maintained/cohere_aws/client.py +++ b/src/cohere/manually_maintained/cohere_aws/client.py @@ -39,7 +39,8 @@ def __init__( """ if not AWS_DEPS_AVAILABLE: raise CohereError("AWS dependencies not available. Please install boto3 and sagemaker.") - self._client = boto3.client("sagemaker") + self._client = boto3.client("sagemaker-runtime", region_name=aws_region) + self._service_client = boto3.client("sagemaker", region_name=aws_region) if os.environ.get('AWS_DEFAULT_REGION') is None: os.environ['AWS_DEFAULT_REGION'] = aws_region self._sess = sage.Session(sagemaker_client=self._service_client)