解决huggingface不能联网引发的问题

发布时间 2023-11-19 13:13:01作者: FrostyForest

通过StableDiffusionXLPipeline.from_single_file离线加载模型

pipe = StableDiffusionXLPipeline.from_single_file(
    pretrained_model_link_or_path=r"C:\code\stable-diffusion-webui\models\Stable-diffusion\HoloAnime-XL-V2.5-half.safetensors",original_config_file=r"C:\code\stable-diffusion-webui\configs\sd_xl_base.yaml",local_files_only=True, torch_dtype=torch.float16).to("cuda")

Can't load tokenizer问题

huggingface的缓存目录.cache通常在C:\Users\Username

把所需的文件下载到.cache/huggingface/transformers