本文主要是介绍huggingface 连不上 from_pretrained from_single_file,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
huggingface的缓存目录 ~/.cach
cd ~/.cache
# pwd 后展示 /home/fxbox/.cache
pwd
pipe: StableDiffusionPipeline = StableDiffusionPipeline.from_pretrained(model_id_or_path,
).to(device=self.device, dtype=self.dtype)
改为:
if os.path.exists(model_id_or_path):pipe: StableDiffusionPipeline = StableDiffusionPipeline.from_single_file(model_id_or_path).to(device=self.device, dtype=self.dtype)
else:pipe: StableDiffusionPipeline = StableDiffusionPipeline.from_pretrained(model_id_or_path,).to(device=self.device, dtype=self.dtype)
参考:
https://www.cnblogs.com/FrostyForest/p/17841926.html
python diffusers StableDiffusionXLPipeline 离线使用_runwayml/stable-diffusion-v1-5 离线下载-CSDN博客
这篇关于huggingface 连不上 from_pretrained from_single_file的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!