Linaqruf / kohya-trainer

Adapted from https://note.com/kohya_ss/n/nbf7ce8d80f29 for easier cloning
Apache License 2.0
1.83k stars 300 forks source link

Download custom model ----aria2c: error while loading shared libraries: libnettle.so.7: cannot open shared object file: No such file or directory #256

Closed ApchDio closed 1 year ago

ApchDio commented 1 year ago

@title ## 2.2. Download Custom Model

import os

%store -r

os.chdir(root_dir)

@markdown ### Custom model

modelUrls = "https://civitai.com/api/download/models/84576" # @param {'type': 'string'}

def install(url): base_name = os.path.basename(url)

if "drive.google.com" in url:
    os.chdir(pretrained_model)
    !gdown --fuzzy {url}
elif "huggingface.co" in url:
    if "/blob/" in url:
        url = url.replace("/blob/", "/resolve/")
    # @markdown Change this part with your own huggingface token if you need to download your private model
    hf_token = "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"  # @param {type:"string"}
    user_header = f'"Authorization: Bearer {hf_token}"'
    !aria2c --console-log-level=error --summary-interval=10 --header={user_header} -c -x 16 -k 1M -s 16 -d {pretrained_model} -o {base_name} {url}
else:
    !aria2c --console-log-level=error --summary-interval=10 -c -x 16 -k 1M -s 16 -d {pretrained_model} {url}

if modelUrls: urls = modelUrls.split(",") for url in urls: install(url.strip())

ApchDio commented 1 year ago

Thanks !!!!

zackersd commented 8 months ago

Hey there, I've been attempting to use the Kohya Dreambooth training you provided, but I keep encountering a CalledProcessError. The error seems to appear randomly and it's causing some issues. Is there a way to fix this error? Additionally, sometimes when I try to increase the step count beyond 2500, it doesn't seem to work properly. Could you help me with this too?