Skip to content

Commit

Permalink
Fix toml merge bug (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
moria97 authored Aug 2, 2024
1 parent b37a44d commit b6d5b4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pai_rag/core/rag_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ def get_value(self, key=None):
return self.config[key]

def update(self, new_value: Dynaconf):
self.config.rag.update(new_value, tomlfy=True, merge=True)
if self.config.get("rag", None):
self.config.rag.update(new_value, tomlfy=True, merge=True)

def persist(self):
"""Save configuration to file."""
data = self.config.as_dict()
data["dynaconf_merge"] = True

os.makedirs("localdata", exist_ok=True)
loaders.write(GENERATED_CONFIG_FILE_NAME, DynaBox(data).to_dict(), merge=True)

Expand Down

0 comments on commit b6d5b4e

Please sign in to comment.