-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
67 lines (49 loc) · 1.77 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import yaml
from pathlib import Path
class Config:
def __init__(self, config_path="config.yaml"):
# Get the directory containing this script
current_dir = Path(__file__).parent
# Load the config file
with open(current_dir / config_path, 'r') as f:
self.config = yaml.safe_load(f)
@property
def final_optimal_prompts_file(self):
return self.config['filepaths']['final_optimal_prompts_file']
@property
def development_set_file(self):
return self.config['filepaths']['development_set_file']
@property
def reproductive_group_file(self):
return self.config['filepaths']['reproductive_group_file']
@property
def prompts_with_scores_file(self):
return self.config['filepaths']['prompts_with_scores_file']
@property
def gen_code_output_dir(self):
return self.config['filepaths']['gen_code_output_dir']
@property
def bandit_output_dir(self):
return self.config['filepaths']['bandit_output_dir']
@property
def test_set_file(self):
return self.config['filepaths']['test_set_file']
@property
def test_output_file(self):
return self.config['filepaths']['test_output_file']
@property
def test_prompts_file(self):
return self.config['filepaths']['test_prompts_file']
@property
def evaluation_results_file(self):
return self.config['filepaths']['evaluation_results_file']
@property
def temp_output_dir(self):
return self.config['filepaths']['temp_output_dir']
@property
def optimization_iterations(self):
return self.config['GPS_parameters']['iterations']
@property
def optimization_k(self):
return self.config['GPS_parameters']['K']
config = Config()