respect model dir for downloads (#3077) (#3079)

This commit is contained in:
micsthepick 2023-07-12 07:55:46 +10:00 committed by GitHub
parent 3778816b8d
commit 3708de2b1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,7 +145,13 @@ def download_model_wrapper(repo_id, progress=gr.Progress()):
links, sha256, is_lora = downloader.get_download_links_from_huggingface(model, branch, text_only=False)
yield ("Getting the output folder")
output_folder = downloader.get_output_folder(model, branch, is_lora)
models_dir = Path(shared.args.model_dir)
# If the last part of the path is "models", remove it
if models_dir.name.lower() == 'models':
models_dir = models_dir.parent
output_folder = downloader.get_output_folder(model, branch, is_lora, base_folder=models_dir)
if check:
progress(0.5)