|
13 | 13 | """A class for SageMaker AutoML Jobs."""
|
14 | 14 | from __future__ import absolute_import
|
15 | 15 |
|
| 16 | +import logging |
16 | 17 | from six import string_types
|
17 | 18 |
|
18 | 19 | from sagemaker import Model, PipelineModel
|
|
21 | 22 | from sagemaker.session import Session
|
22 | 23 | from sagemaker.utils import name_from_base
|
23 | 24 |
|
| 25 | +logger = logging.getLogger("sagemaker") |
| 26 | + |
24 | 27 |
|
25 | 28 | class AutoML(object):
|
26 | 29 | """A class for creating and interacting with SageMaker AutoML jobs
|
@@ -78,16 +81,15 @@ def fit(self, inputs=None, wait=True, logs=True, job_name=None):
|
78 | 81 | is stored. Or an AutoMLInput object. If a local path is provided, the dataset will
|
79 | 82 | be uploaded to an S3 location.
|
80 | 83 | wait (bool): Whether the call should wait until the job completes (default: True).
|
81 |
| - logs (bool): Whether to show the logs produced by the job. |
82 |
| - Only meaningful when wait is True (default: True). |
| 84 | + logs (bool): Whether to show the logs produced by the job. Only meaningful when wait |
| 85 | + is True (default: True). if ``wait`` is False, ``logs`` will be set to False as |
| 86 | + well. |
83 | 87 | job_name (str): Training job name. If not specified, the estimator generates
|
84 | 88 | a default job name, based on the training image name and current timestamp.
|
85 | 89 | """
|
86 |
| - if logs and not wait: |
87 |
| - raise ValueError( |
88 |
| - """Logs can only be shown if wait is set to True. |
89 |
| - Please either set wait to True or set logs to False.""" |
90 |
| - ) |
| 90 | + if not wait and logs: |
| 91 | + logs = False |
| 92 | + logger.warning("Setting logs to False. logs is only meaningful when wait is True.") |
91 | 93 |
|
92 | 94 | # upload data for users if provided local path
|
93 | 95 | # validations are done in _Job._format_inputs_to_input_config
|
|
0 commit comments