From 001a52cf6970d006837cc558ceb8487c1e4fdcd9 Mon Sep 17 00:00:00 2001 From: tazlin Date: Wed, 4 Oct 2023 10:55:42 -0400 Subject: [PATCH] fix: put horde_model_reference in the right place --- download_models.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/download_models.py b/download_models.py index b5b1154b..62a41b90 100644 --- a/download_models.py +++ b/download_models.py @@ -1,4 +1,3 @@ -from horde_model_reference.model_reference_manager import ModelReferenceManager from loguru import logger from horde_worker_regen.bridge_data.load_config import BridgeDataLoader, reGenBridgeData @@ -6,25 +5,30 @@ def main() -> None: - horde_model_reference_manager = ModelReferenceManager( - download_and_convert_legacy_dbs=True, - override_existing=True, - ) - - if not horde_model_reference_manager.download_and_convert_all_legacy_dbs(override_existing=True): - logger.error("Failed to download and convert legacy DBs. Retrying in 5 seconds...") - bridge_data: reGenBridgeData try: bridge_data = BridgeDataLoader.load( file_path=BRIDGE_CONFIG_FILENAME, - horde_model_reference_manager=horde_model_reference_manager, ) bridge_data.load_env_vars() except Exception as e: logger.error(e) input("Press any key to exit...") + from horde_model_reference.model_reference_manager import ModelReferenceManager + + horde_model_reference_manager = ModelReferenceManager( + download_and_convert_legacy_dbs=True, + override_existing=True, + ) + bridge_data.image_models_to_load = BridgeDataLoader._resolve_meta_instructions( + bridge_data, + horde_model_reference_manager, + ) + + if not horde_model_reference_manager.download_and_convert_all_legacy_dbs(override_existing=True): + logger.error("Failed to download and convert legacy DBs. Retrying in 5 seconds...") + import hordelib hordelib.initialise()