Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: (fix) detect and move lora.json in site-packages #284

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions bridge_stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ def check_for_old_dir():
else:
print("Existing custom models left in their previous location.")

possible_lora_paths = [
"conda/envs/windows/Lib/site-packages/hordelib/model_database/lora.json",
"conda/envs/linux/Lib/site-packages/hordelib/model_database/lora.json",
]
for path in possible_lora_paths:
if os.path.exists(path):
print("Old lora.json file exists.")
print(
f"Correct location is: {os.environ['AIWORKER_CACHE_HOME']}/horde_model_reference/legacy/lora.json",
)
answer = input("Do you want to move it to the correct location [Y/N]? ")
if answer.lower() == "y":
import shutil

shutil.move(
path,
os.environ["AIWORKER_CACHE_HOME"] + "/horde_model_reference/legacy/lora.json",
)
print("lora.json file has been moved to the correct location.")


def main():
set_logger_verbosity(args.verbosity)
Expand Down