@@ -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