Spaces:
Running
Running
regraded01
commited on
Commit
·
5245b11
1
Parent(s):
ce61e92
fix: return elements in the same order as input config_keys
Browse files- src/utils.py +4 -4
src/utils.py
CHANGED
@@ -5,7 +5,7 @@ model_config_dir = "config/model_config.yml"
|
|
5 |
config_keys = ["system_message", "model_id", "template"]
|
6 |
|
7 |
def load_config_values(
|
8 |
-
model_config_dir=model_config_dir,
|
9 |
config_keys=config_keys
|
10 |
):
|
11 |
"""
|
@@ -16,9 +16,9 @@ def load_config_values(
|
|
16 |
model_config = yaml.safe_load(file)
|
17 |
|
18 |
values_list = []
|
19 |
-
for var in
|
20 |
-
if var not in
|
21 |
raise ValueError(f"`{var}` key missing from `{model_config_dir}`")
|
22 |
values_list.append(model_config[var])
|
23 |
|
24 |
-
return values_list
|
|
|
5 |
config_keys = ["system_message", "model_id", "template"]
|
6 |
|
7 |
def load_config_values(
|
8 |
+
model_config_dir=model_config_dir,
|
9 |
config_keys=config_keys
|
10 |
):
|
11 |
"""
|
|
|
16 |
model_config = yaml.safe_load(file)
|
17 |
|
18 |
values_list = []
|
19 |
+
for var in config_keys:
|
20 |
+
if var not in model_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
|