This commit is contained in:
Saifeddine ALOUI 2024-03-20 23:07:10 +01:00
parent 72b307d37d
commit 37a090d4f4
2 changed files with 5 additions and 1 deletions

View File

@ -275,6 +275,7 @@ class BaseConfig:
return self.config[key] return self.config[key]
def copy(self): def copy(self):
return BaseConfig(self.exceptional_keys, self.config.copy(), self.file_path) return BaseConfig(self.exceptional_keys, self.config.copy(), self.file_path)
def __getattr__(self, key): def __getattr__(self, key):

View File

@ -64,7 +64,10 @@ class LOLLMSConfig(BaseConfig):
else: else:
self.lollms_paths = lollms_paths self.lollms_paths = lollms_paths
def copy(self):
cfg = LOLLMSConfig(self.file_path, self.lollms_paths)
cfg.config = self.config.copy()
return cfg
@staticmethod @staticmethod
def autoload(lollms_paths:LollmsPaths, config_path:str=None): def autoload(lollms_paths:LollmsPaths, config_path:str=None):
# Configuration loading part # Configuration loading part