picobyte / stable-diffusion-webui-wd14-tagger

Labeling extension for Automatic1111's Web UI
540 stars 64 forks source link

Still halt the page when fail on loading mode,even the Model exsit in local path. #46

Open gamert opened 11 months ago

gamert commented 11 months ago

Please change the load method . We all know "hf_hub_download" will be blocked At Random.

Ln 430: def load(self) -> None: model_path, tags_path = self.download()

gamert commented 11 months ago

May use "get_file_from_repo" directly? Or may let Buttom can be click again when exception raise.

RoelKluin commented 10 months ago

I agree this is a mess. I was trying to fix it in a branch but it's a lot of work to automate this. I kind of think it would be best if the wd14 tagger would not attempt to download itself but would require the user to do this, but then for people for which it does currently work, this would be a regression.

picobyte commented 10 months ago

Huggingface supports some environment variables. so if you know you cannot download, if you run export HF_HUB_OFFLINE=1 before you start the webui, does that resolve the issue for you?

gamert commented 10 months ago

"HF_HUB_OFFLINE=1" will affect global downing? So I add “, local_files_only=True” in hf_hub_download(interrogator.py) to bypass the exception。This is ok for me because I have downed the models :)

model_path = hf_hub_download( repo_id=self.repo_id, filename=self.model_path, cache_dir=cache, local_files_only=True)

picobyte commented 10 months ago

So this indeed solved it for you? otherwise let me know.