refactor: update configuration handling and OpenAI client initialization
This commit is contained in:
@@ -149,7 +149,14 @@ class Config:
|
||||
FileNotFoundError: Configuration file not found
|
||||
"""
|
||||
if not os.path.exists(config_path):
|
||||
raise FileNotFoundError(f"Configuration file not found: {config_path}")
|
||||
# copy base config file to the given path
|
||||
base = "config/base_config.yaml"
|
||||
if not os.path.exists(base):
|
||||
raise FileNotFoundError(f"Base configuration file not found: {base}")
|
||||
with open(base, "r") as base_file:
|
||||
base_config = base_file.read()
|
||||
with open(config_path, "w") as config_file:
|
||||
config_file.write(base_config)
|
||||
self._config = OmegaConf.load(config_path)
|
||||
self.config_path = config_path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user