Where are models installed by default ? #6675
-
When you run this code where is the model located how to find out the path to the model itself ? model_id = "stabilityai/stable-diffusion-2-1" |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi @Infinitusvoid. diffusers uses
If you'd like to change the location where your models are downloaded by default, you could do this: # If you want the variable to persist everytime you run a shell
echo "export HF_HOME=/home/profile/path/to/model/directory" >> ~/.bashrc # or config file for whatever terminal you use
# You could also create a symbolic link from your directory to HF_HUB_CACHE
ln -s /path/to/your/model/directory $HF_HUB_CACHE You could also achieve the same by using the model_id = "stabilityai/stable-diffusion-2-1"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, cache_dir="/path/to/model/directory") |
Beta Was this translation helpful? Give feedback.
-
I get an empty line.
… On 30 Dec 2024, at 14:06, Aryan ***@***.***> wrote:
What output do you get when you run echo $HF_HOME in your terminal?
—
Reply to this email directly, view it on GitHub <#6675 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BOCI3IHSFL2RWFNYSMX4Q532IFAPDAVCNFSM6AAAAABCFZGI2SVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRZGY3TGNA>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
Hi @Infinitusvoid.
diffusers uses
huggingface/huggingface_hub
to download and store models that you use. This provides you with a list of environment variables that hub uses by default.HF_HUB_CACHE
is what you're looking for, and by default it is~/.cache/huggingface/hub
, where~
means your home directory for your profile on windows/linux/mac.If you'd like to change the location where your models are downloaded by default, you could do this: