diff --git a/server.py b/server.py index 18474d3..412f13e 100644 --- a/server.py +++ b/server.py @@ -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)