mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-02-06 00:40:42 +01:00
Use custom model/lora download folder in model downloader
This commit is contained in:
parent
d64459e20d
commit
1b44204bd7
@ -22,6 +22,7 @@ import tqdm
|
|||||||
from requests.adapters import HTTPAdapter
|
from requests.adapters import HTTPAdapter
|
||||||
from requests.exceptions import ConnectionError, RequestException, Timeout
|
from requests.exceptions import ConnectionError, RequestException, Timeout
|
||||||
from tqdm.contrib.concurrent import thread_map
|
from tqdm.contrib.concurrent import thread_map
|
||||||
|
from modules import shared
|
||||||
|
|
||||||
base = os.environ.get("HF_ENDPOINT") or "https://huggingface.co"
|
base = os.environ.get("HF_ENDPOINT") or "https://huggingface.co"
|
||||||
|
|
||||||
@ -165,7 +166,7 @@ class ModelDownloader:
|
|||||||
return links, sha256, is_lora, is_llamacpp
|
return links, sha256, is_lora, is_llamacpp
|
||||||
|
|
||||||
def get_output_folder(self, model, branch, is_lora, is_llamacpp=False):
|
def get_output_folder(self, model, branch, is_lora, is_llamacpp=False):
|
||||||
base_folder = 'models' if not is_lora else 'loras'
|
base_folder = shared.args.model_dir if not is_lora else shared.args.lora_dir
|
||||||
|
|
||||||
# If the model is of type GGUF, save directly in the base_folder
|
# If the model is of type GGUF, save directly in the base_folder
|
||||||
if is_llamacpp:
|
if is_llamacpp:
|
||||||
|
@ -290,11 +290,6 @@ def download_model_wrapper(repo_id, specific_file, progress=gr.Progress(), retur
|
|||||||
yield ("Getting the output folder")
|
yield ("Getting the output folder")
|
||||||
output_folder = downloader.get_output_folder(model, branch, is_lora, is_llamacpp=is_llamacpp)
|
output_folder = downloader.get_output_folder(model, branch, is_lora, is_llamacpp=is_llamacpp)
|
||||||
|
|
||||||
if output_folder == Path("models"):
|
|
||||||
output_folder = Path(shared.args.model_dir)
|
|
||||||
elif output_folder == Path("loras"):
|
|
||||||
output_folder = Path(shared.args.lora_dir)
|
|
||||||
|
|
||||||
if check:
|
if check:
|
||||||
progress(0.5)
|
progress(0.5)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user