Spaces:
Running
Running
regraded01
commited on
Commit
•
2b7a8a5
1
Parent(s):
d628c92
feat: return a list to allow for unpacking
Browse files- src/utils.py +5 -5
src/utils.py
CHANGED
@@ -10,15 +10,15 @@ def load_config_values(
|
|
10 |
):
|
11 |
"""
|
12 |
Function to extract user-input keys from config.yml
|
13 |
-
Returns
|
14 |
-
TO DO: fix how the function returns values so can be flexible (based on the order of the input `config_keys` list)
|
15 |
-
|
16 |
"""
|
17 |
with open(model_config_dir, "r") as file:
|
18 |
model_config = yaml.safe_load(file)
|
19 |
|
|
|
20 |
for var in model_config.keys():
|
21 |
if var not in config_keys:
|
22 |
raise ValueError(f"`{var}` key missing from `{model_config_dir}`")
|
23 |
-
|
24 |
-
|
|
|
|
10 |
):
|
11 |
"""
|
12 |
Function to extract user-input keys from config.yml
|
13 |
+
Returns values as a list with length = length(config_keys)
|
|
|
|
|
14 |
"""
|
15 |
with open(model_config_dir, "r") as file:
|
16 |
model_config = yaml.safe_load(file)
|
17 |
|
18 |
+
values_list = []
|
19 |
for var in model_config.keys():
|
20 |
if var not in config_keys:
|
21 |
raise ValueError(f"`{var}` key missing from `{model_config_dir}`")
|
22 |
+
values_list.append(model_config[var])
|
23 |
+
|
24 |
+
return values_list
|