@@ -413,16 +413,22 @@ def _validate_source_code(self, source_code: Optional[SourceCode]):
413
413
)
414
414
if requirements :
415
415
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
+ ):
418
421
raise ValueError (
419
422
f"Invalid 'requirements': { requirements } . "
420
423
+ "Must be a valid file within the 'source_dir'." ,
421
424
)
422
425
if entry_script :
423
426
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
+ ):
426
432
raise ValueError (
427
433
f"Invalid 'entry_script': { entry_script } . "
428
434
+ "Must be a valid file within the 'source_dir'." ,
@@ -837,8 +843,8 @@ def _prepare_train_script(
837
843
install_requirements = ""
838
844
if source_code .requirements :
839
845
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 } "
842
848
)
843
849
844
850
working_dir = ""
0 commit comments