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

fix: env vars to http client in sagemaker #35

Merged
merged 3 commits into from
Jan 3, 2024
Merged
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
9 changes: 8 additions & 1 deletion ai21/services/sagemaker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import List

from ai21 import AI21EnvConfig
from ai21.ai21_http_client import AI21HTTPClient
from ai21.clients.sagemaker.constants import (
SAGEMAKER_MODEL_PACKAGE_NAMES,
Expand Down Expand Up @@ -56,7 +57,13 @@ def list_model_package_versions(cls, model_name: str, region: str) -> List[str]:

@classmethod
def _create_ai21_http_client(cls) -> AI21HTTPClient:
return AI21HTTPClient()
return AI21HTTPClient(
api_key=AI21EnvConfig.api_key,
api_host=AI21EnvConfig.api_host,
api_version=AI21EnvConfig.api_version,
timeout_sec=AI21EnvConfig.timeout_sec,
num_retries=AI21EnvConfig.num_retries,
)


def _assert_model_package_exists(model_name, region):
Expand Down
Loading