File tree Expand file tree Collapse file tree 3 files changed +28
-18
lines changed Expand file tree Collapse file tree 3 files changed +28
-18
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,20 @@ def __init__(self, config_file):
33
33
34
34
cfg = get_config (config_file )
35
35
36
+ # Build config
37
+ try :
38
+ OUTPUT_PATH = cfg ["build" ]["output_path" ]
39
+ S3_SLUG = cfg ["data" ]["s3_slug" ]
40
+ except KeyError :
41
+ config_dir , missing_config = os .path .split (config_file )
42
+ files = os .listdir (config_dir )
43
+ other_configs = [f for f in os .listdir (config_dir ) if os .path .isfile (os .path .join (config_dir , f ))]
44
+ msg .fail (f"Could not find config { missing_config } , perhaps you meant one of { other_configs } " )
45
+
36
46
msg .info (
37
47
f"Attempting to download model artefacts if they are not found locally in { cfg ['build' ]['output_path' ]} . This may take some time..."
38
48
)
39
49
40
- # Build config
41
-
42
- OUTPUT_PATH = cfg ["build" ]["output_path" ]
43
- S3_SLUG = cfg ["data" ]["s3_slug" ]
44
-
45
50
# Check whether the necessary artefacts exists and download them if
46
51
# not.
47
52
Original file line number Diff line number Diff line change @@ -37,15 +37,20 @@ def __init__(self, config_file):
37
37
38
38
cfg = get_config (config_file )
39
39
40
+ # Build config
41
+ try :
42
+ OUTPUT_PATH = cfg ["build" ]["output_path" ]
43
+ S3_SLUG = cfg ["data" ]["s3_slug" ]
44
+ except KeyError :
45
+ config_dir , missing_config = os .path .split (config_file )
46
+ files = os .listdir (config_dir )
47
+ other_configs = [f for f in os .listdir (config_dir ) if os .path .isfile (os .path .join (config_dir , f ))]
48
+ msg .fail (f"Could not find config { missing_config } , perhaps you meant one of { other_configs } " )
49
+
40
50
msg .info (
41
51
f"Attempting to download model artefacts if they are not found locally in { cfg ['build' ]['output_path' ]} . This may take some time..."
42
52
)
43
53
44
- # Build config
45
-
46
- OUTPUT_PATH = cfg ["build" ]["output_path" ]
47
- S3_SLUG = cfg ["data" ]["s3_slug" ]
48
-
49
54
# Check whether the necessary artefacts exists and download them if
50
55
# not.
51
56
Original file line number Diff line number Diff line change @@ -37,14 +37,14 @@ def __init__(self, config_file):
37
37
38
38
cfg = get_config (config_file )
39
39
40
- msg . info (
41
- f"Attempting to download model artefacts if they are not found locally in { cfg [' build' ][ ' output_path' ] } . This may take some time..."
42
- )
43
-
44
- # Build config
45
-
46
- OUTPUT_PATH = cfg [ "build" ][ "output_path" ]
47
- S3_SLUG = cfg [ "data" ][ "s3_slug" ]
40
+ try :
41
+ OUTPUT_PATH = cfg [" build" ][ " output_path" ]
42
+ S3_SLUG = cfg [ "data" ][ "s3_slug" ]
43
+ except KeyError :
44
+ config_dir , missing_config = os . path . split ( config_file )
45
+ files = os . listdir ( config_dir )
46
+ other_configs = [ f for f in os . listdir ( config_dir ) if os . path . isfile ( os . path . join ( config_dir , f )) ]
47
+ msg . fail ( f"Could not find config { missing_config } , perhaps you meant one of { other_configs } " )
48
48
49
49
# Check whether the necessary artefacts exists and download them if
50
50
# not.
You can’t perform that action at this time.
0 commit comments