[Python]The location where downloaded models are saved, such as from_pretrained.

この記事は約2分で読めます。
スポンサーリンク

Things I want to do

When you run test code for a model, the model may be automatically downloaded and executed from huggingface. However, in most cases, the downloaded model is not saved near the code that was executed. (You can see that it is saved locally because it is not downloaded again on subsequent runs.)

Since it’s a model, the file size is large, so you should organize it as needed.

This article explains where downloaded files are saved in a Windows 11 environment.

スポンサーリンク

Storage location

The model will be saved in the following location:

C:\Users\username\.cache\huggingface

* The username is your Windows login name.

* Depending on the environment, ‘Users’ may be displayed as ‘Users’.

スポンサーリンク

bonus

How to set the model’s location using from_pretrained

Set the argument of `from_pretrained` to `cache_dir=’path’`. A relative path is fine.

How to set the model location in hf_hub_download

Set the `cache_dir=’path’` argument to `hf_hub_download`. A relative path is fine.

コメント

タイトルとURLをコピーしました