Skip to content

Commit a82cb7a

Browse files
author
Christian Osendorfer
committed
Updating PR.
Fixing omissions and formating.
1 parent dbdf106 commit a82cb7a

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/sagemaker/estimator.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,11 @@ def _json_encode_hyperparameters(hyperparameters: Dict[str, Any]) -> Dict[str, A
598598
current_hyperparameters = hyperparameters
599599
if current_hyperparameters is not None:
600600
hyperparameters = {
601-
str(k): (v if isinstance(
602-
v, (str, int, float, bool, Parameter, Expression, Properties)
603-
) else json.dumps(v))
601+
str(k): (
602+
v
603+
if isinstance(v, (str, int, float, bool, Parameter, Expression, Properties))
604+
else json.dumps(v)
605+
)
604606
for (k, v) in current_hyperparameters.items()
605607
}
606608
return hyperparameters

src/sagemaker/local/image.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def _prepare_training_volumes(
493493
# If there is a training script directory and it is a local directory,
494494
# mount it to the container.
495495
if sagemaker.estimator.DIR_PARAM_NAME in hyperparameters:
496-
training_dir = json.loads(hyperparameters[sagemaker.estimator.DIR_PARAM_NAME])
496+
training_dir = hyperparameters[sagemaker.estimator.DIR_PARAM_NAME]
497497
parsed_uri = urlparse(training_dir)
498498
if parsed_uri.scheme == "file":
499499
host_dir = os.path.abspath(parsed_uri.netloc + parsed_uri.path)

tests/unit/test_estimator.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1337,8 +1337,7 @@ def test_shuffle_config(sagemaker_session):
13371337

13381338
BASE_HP = {
13391339
"sagemaker_program": SCRIPT_NAME,
1340-
"sagemaker_submit_directory":
1341-
"s3://mybucket/{}/source/sourcedir.tar.gz".format(JOB_NAME),
1340+
"sagemaker_submit_directory": "s3://mybucket/{}/source/sourcedir.tar.gz".format(JOB_NAME),
13421341
"sagemaker_job_name": JOB_NAME,
13431342
}
13441343

0 commit comments

Comments
 (0)