From a78b4f3d02009f6760b2bacc2e3dbf8428d146fc Mon Sep 17 00:00:00 2001 From: BBC-Esq Date: Sun, 13 Oct 2024 23:08:04 -0400 Subject: [PATCH] v6.9.0 --- src/setup_windows.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/setup_windows.py b/src/setup_windows.py index f9dbf453..841e15fe 100644 --- a/src/setup_windows.py +++ b/src/setup_windows.py @@ -469,9 +469,34 @@ def download_kobold(): download_kobold() +# 9. update config.yaml to include jeeves database +def update_config_yaml(): + import yaml + script_dir = os.path.dirname(os.path.abspath(__file__)) + config_path = os.path.join(script_dir, 'config.yaml') + + with open(config_path, 'r', encoding='utf-8') as file: + config = yaml.safe_load(file) + + vector_model_path = os.path.join(script_dir, 'Models', 'vector', 'thenlper--gte-base') + + if 'created_databases' not in config: + config['created_databases'] = {} + if 'user_manual' not in config['created_databases']: + config['created_databases']['user_manual'] = {} + + config['created_databases']['user_manual']['chunk_overlap'] = 349 + config['created_databases']['user_manual']['chunk_size'] = 700 + config['created_databases']['user_manual']['model'] = vector_model_path + + with open(config_path, 'w', encoding='utf-8') as file: + yaml.dump(config, file, default_flow_style=False) + +update_config_yaml() + end_time = time.time() total_time = end_time - start_time hours, rem = divmod(total_time, 3600) minutes, seconds = divmod(rem, 60) -print(f"\033[92m\nTotal installation time: {int(hours):02d}:{int(minutes):02d}:{seconds:05.2f}\033[0m") \ No newline at end of file +print(f"\033[92m\nTotal installation time: {int(hours):02d}:{int(minutes):02d}:{seconds:05.2f}\033[0m")