@@ -63,7 +63,7 @@ def __init__(
6363 self .generate_candidate_definitions_only = generate_candidate_definitions_only
6464 self .tags = tags
6565
66- self ._current_job_name = None
66+ self .current_job_name = None
6767 self ._auto_ml_job_desc = None
6868 self ._best_candidate = None
6969 self .sagemaker_session = sagemaker_session or Session ()
@@ -111,7 +111,7 @@ def describe_auto_ml_job(self, job_name=None):
111111 dict: A dictionary response with the AutoML Job description.
112112 """
113113 if job_name is None :
114- job_name = self ._current_job_name
114+ job_name = self .current_job_name
115115 self ._auto_ml_job_desc = self .sagemaker_session .describe_auto_ml_job (job_name )
116116 return self ._auto_ml_job_desc
117117
@@ -128,7 +128,7 @@ def best_candidate(self, job_name=None):
128128 return self ._best_candidate
129129
130130 if job_name is None :
131- job_name = self ._current_job_name
131+ job_name = self .current_job_name
132132 if self ._auto_ml_job_desc is None :
133133 self ._auto_ml_job_desc = self .sagemaker_session .describe_auto_ml_job (job_name )
134134 elif self ._auto_ml_job_desc ["AutoMLJobName" ] != job_name :
@@ -168,7 +168,7 @@ def list_candidates(
168168 list: A list of dictionaries with candidates information
169169 """
170170 if job_name is None :
171- job_name = self ._current_job_name
171+ job_name = self .current_job_name
172172
173173 list_candidates_args = {"job_name" : job_name }
174174
@@ -249,6 +249,7 @@ def deploy(
249249 candidate = CandidateEstimator (candidate , sagemaker_session = sagemaker_session )
250250
251251 inference_containers = candidate .containers
252+ endpoint_name = endpoint_name or self .current_job_name
252253
253254 return self ._deploy_inference_pipeline (
254255 inference_containers ,
@@ -373,14 +374,14 @@ def _prepare_for_auto_ml_job(self, job_name=None):
373374 created from base_job_name or "sagemaker-auto-ml".
374375 """
375376 if job_name is not None :
376- self ._current_job_name = job_name
377+ self .current_job_name = job_name
377378 else :
378379 if self .base_job_name :
379380 base_name = self .base_job_name
380381 else :
381382 base_name = "sagemaker-auto-ml"
382383 # CreateAutoMLJob API validates that member length less than or equal to 32
383- self ._current_job_name = name_from_base (base_name , max_length = 32 )
384+ self .current_job_name = name_from_base (base_name , max_length = 32 )
384385
385386 if self .output_path is None :
386387 self .output_path = "s3://{}/" .format (self .sagemaker_session .default_bucket ())
@@ -426,6 +427,7 @@ class AutoMLJob(_Job):
426427
427428 def __init__ (self , sagemaker_session , job_name , inputs ):
428429 self .inputs = inputs
430+ self .job_name = job_name
429431 super (AutoMLJob , self ).__init__ (sagemaker_session = sagemaker_session , job_name = job_name )
430432
431433 @classmethod
@@ -444,13 +446,13 @@ def start_new(cls, auto_ml, inputs):
444446 """
445447 config = cls ._load_config (inputs , auto_ml )
446448 auto_ml_args = config .copy ()
447- auto_ml_args ["job_name" ] = auto_ml ._current_job_name
449+ auto_ml_args ["job_name" ] = auto_ml .current_job_name
448450 auto_ml_args ["problem_type" ] = auto_ml .problem_type
449451 auto_ml_args ["job_objective" ] = auto_ml .job_objective
450452 auto_ml_args ["tags" ] = auto_ml .tags
451453
452454 auto_ml .sagemaker_session .auto_ml (** auto_ml_args )
453- return cls (auto_ml .sagemaker_session , auto_ml ._current_job_name , inputs )
455+ return cls (auto_ml .sagemaker_session , auto_ml .current_job_name , inputs )
454456
455457 @classmethod
456458 def _load_config (cls , inputs , auto_ml , expand_role = True , validate_uri = True ):
0 commit comments