forked from aws/sagemaker-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
71 lines (69 loc) · 3.2 KB
/
__init__.py
File metadata and controls
71 lines (69 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
"""SageMaker Python SDK Train Module."""
from __future__ import absolute_import
# Lazy imports to avoid circular dependencies
# Session and get_execution_role are available from sagemaker.core.helper.session_helper
# Import them directly from there if needed, or use lazy import pattern
def __getattr__(name):
"""Lazy import to avoid circular dependencies."""
if name == "Session":
from sagemaker.core.helper.session_helper import Session
return Session
elif name == "get_execution_role":
from sagemaker.core.helper.session_helper import get_execution_role
return get_execution_role
elif name == "ModelTrainer":
from sagemaker.train.model_trainer import ModelTrainer
return ModelTrainer
elif name == "logger":
from sagemaker.core.utils.utils import logger
return logger
# Evaluate module exports
elif name == "BaseEvaluator":
from sagemaker.train.evaluate import BaseEvaluator
return BaseEvaluator
elif name == "BenchMarkEvaluator":
from sagemaker.train.evaluate import BenchMarkEvaluator
return BenchMarkEvaluator
elif name == "CustomScorerEvaluator":
from sagemaker.train.evaluate import CustomScorerEvaluator
return CustomScorerEvaluator
elif name == "LLMAsJudgeEvaluator":
from sagemaker.train.evaluate import LLMAsJudgeEvaluator
return LLMAsJudgeEvaluator
elif name == "EvaluationPipelineExecution":
from sagemaker.train.evaluate import EvaluationPipelineExecution
return EvaluationPipelineExecution
elif name == "get_benchmarks":
from sagemaker.train.evaluate import get_benchmarks
return get_benchmarks
elif name == "get_benchmark_properties":
from sagemaker.train.evaluate import get_benchmark_properties
return get_benchmark_properties
elif name == "get_builtin_metrics":
from sagemaker.train.evaluate import get_builtin_metrics
return get_builtin_metrics
elif name == "plot_training_metrics":
from sagemaker.train.common_utils.metrics_visualizer import plot_training_metrics
return plot_training_metrics
elif name == "get_available_metrics":
from sagemaker.train.common_utils.metrics_visualizer import get_available_metrics
return get_available_metrics
elif name == "get_studio_url":
from sagemaker.train.common_utils.metrics_visualizer import get_studio_url
return get_studio_url
elif name == "get_mlflow_url":
from sagemaker.train.common_utils.trainer_wait import get_mlflow_url
return get_mlflow_url
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")