enhanced configuration loading

This commit is contained in:
saloui 2023-06-12 15:45:59 +02:00
parent d10fc189ce
commit 5c7eb8a60a
5 changed files with 6 additions and 22 deletions

24
app.py
View File

@ -1181,26 +1181,8 @@ if __name__ == "__main__":
)
args = parser.parse_args()
# The default configuration must be kept unchanged as it is committed to the repository,
# so we have to make a copy that is not comitted
default_config = load_config("configs/config.yaml")
if args.config!="local_config":
args.config = "local_config"
if not lollms_paths.personal_configuration_path/f"local_config.yaml".exists():
print("No local configuration file found. Building from scratch")
shutil.copy(default_config, lollms_paths.personal_configuration_path/f"local_config.yaml")
config_file_path = lollms_paths.personal_configuration_path/f"local_config.yaml"
config = LOLLMSConfig(config_file_path)
if "version" not in config or int(config["version"])<int(default_config["version"]):
#Upgrade old configuration files to new format
ASCIIColors.error("Configuration file is very old.\nReplacing with default configuration")
config, added, removed = sync_cfg(default_config, config)
print(f"Added entries : {added}, removed entries:{removed}")
config.save_config(config_file_path)
# Configuration loading part
config = LOLLMSConfig.autoload(lollms_paths)
# Override values in config with command-line arguments
for arg_name, arg_value in vars(args).items():
@ -1209,7 +1191,7 @@ if __name__ == "__main__":
# executor = ThreadPoolExecutor(max_workers=1)
# app.config['executor'] = executor
bot = LoLLMsWebUI(app, socketio, config, config_file_path, lollms_paths)
bot = LoLLMsWebUI(app, socketio, config, config.file_path, lollms_paths)
# chong Define custom WebSocketHandler with error handling
class CustomWebSocketHandler(WebSocketHandler):

View File

@ -1,7 +1,7 @@
# =================== Lord Of Large Language Models Configuration file ===========================
version: 7
binding_name: llama_cpp_official
model_name: Wizard-Vicuna-7B-Uncensored.ggmlv3.q4_0.bin
model_name: airoboros-13b-gpt4.ggmlv3.q4_0.bin
# Host information
host: localhost

View File

1
web/src/clip Submodule

@ -0,0 +1 @@
Subproject commit a9b1bf5920416aaeaec965c25dd9e8f98c864f16

@ -0,0 +1 @@
Subproject commit 3ba01b241669f5ade541ce990f7650a3b8f65318