Skip to content

Commit

Permalink
fix: put horde_model_reference in the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Oct 4, 2023
1 parent 809f95e commit 001a52c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions download_models.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
from horde_model_reference.model_reference_manager import ModelReferenceManager
from loguru import logger

from horde_worker_regen.bridge_data.load_config import BridgeDataLoader, reGenBridgeData
from horde_worker_regen.consts import BRIDGE_CONFIG_FILENAME


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()
Expand Down

0 comments on commit 001a52c

Please sign in to comment.