mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-04-11 12:49:56 +00:00
enhanced configuration loading
This commit is contained in:
parent
d10fc189ce
commit
5c7eb8a60a
24
app.py
24
app.py
@ -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):
|
||||
|
@ -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
|
||||
|
1
web/src/clip
Submodule
1
web/src/clip
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a9b1bf5920416aaeaec965c25dd9e8f98c864f16
|
1
web/src/taming-transformers
Submodule
1
web/src/taming-transformers
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 3ba01b241669f5ade541ce990f7650a3b8f65318
|
Loading…
x
Reference in New Issue
Block a user