We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db42dc5 commit 60dd883Copy full SHA for 60dd883
src/sagemaker/serve/spec/inference_base.py
@@ -18,12 +18,18 @@
18
class CustomOrchestrator(ABC):
19
"""Templated class to standardize sync entrypoint-based inference scripts"""
20
21
+ def __init__(self):
22
+ self._client = None
23
+
24
@property
25
def client(self):
26
"""Boto3 SageMaker runtime client to use with custom orchestrator"""
- from boto3 import Session
27
+ if not hasattr(self, "_client"):
28
+ from boto3 import Session
29
30
+ self._client = Session().client("sagemaker-runtime")
31
- return Session().client("sagemaker-runtime")
32
+ return self._client
33
34
@abstractmethod
35
def handle(self, data, context=None):
0 commit comments