Skip to content

Commit 46ae9c5

Browse files
committed
black-format
1 parent 18f43d1 commit 46ae9c5

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/sagemaker/modules/configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class SourceCode(BaseConfig):
8888
8989
Parameters:
9090
source_dir (Optional[str]):
91-
The local directory, s3 uri, or path to tar.gz file stored locally or in s3 that contains
91+
The local directory, s3 uri, or path to tar.gz file stored locally or in s3 that contains
9292
the source code to be used in the training job container.
9393
requirements (Optional[str]):
9494
The path within ``source_dir`` to a ``requirements.txt`` file. If specified, the listed

src/sagemaker/modules/train/model_trainer.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,16 +413,22 @@ def _validate_source_code(self, source_code: Optional[SourceCode]):
413413
)
414414
if requirements:
415415
if not source_dir.endswith(".tar.gz"):
416-
if (not _is_valid_path(f"{source_dir}/{requirements}", path_type="File")
417-
and not _is_valid_s3_uri(f"{source_dir}/{requirements}", path_type="File")):
416+
if not _is_valid_path(
417+
f"{source_dir}/{requirements}", path_type="File"
418+
) and not _is_valid_s3_uri(
419+
f"{source_dir}/{requirements}", path_type="File"
420+
):
418421
raise ValueError(
419422
f"Invalid 'requirements': {requirements}. "
420423
+ "Must be a valid file within the 'source_dir'.",
421424
)
422425
if entry_script:
423426
if not source_dir.endswith(".tar.gz"):
424-
if (not _is_valid_path(f"{source_dir}/{entry_script}", path_type="File")
425-
and not _is_valid_s3_uri(f"{source_dir}/{entry_script}", path_type="File")):
427+
if not _is_valid_path(
428+
f"{source_dir}/{entry_script}", path_type="File"
429+
) and not _is_valid_s3_uri(
430+
f"{source_dir}/{entry_script}", path_type="File"
431+
):
426432
raise ValueError(
427433
f"Invalid 'entry_script': {entry_script}. "
428434
+ "Must be a valid file within the 'source_dir'.",
@@ -837,8 +843,8 @@ def _prepare_train_script(
837843
install_requirements = ""
838844
if source_code.requirements:
839845
install_requirements = (
840-
"echo 'Installing requirements'\n" +
841-
f"$SM_PIP_CMD install -r {source_code.requirements}"
846+
"echo 'Installing requirements'\n"
847+
+ f"$SM_PIP_CMD install -r {source_code.requirements}"
842848
)
843849

844850
working_dir = ""

0 commit comments

Comments
 (0)