網頁

2026年11月25日 星期三

改變 Hugging Face 下載的模型與快取檔案存放位置

$ vi .bashrc 加入下列
export HF_HOME=/mnt/C1000SSD/hf_home

$ echo $HF_HOME
/mnt/C1000SSD/hf_home
$ rsync -avh ~/.cache/huggingface/ /mnt/C1000SSD/hf_home/
$ sudo chown -R $USER:$USER /mnt/C1000SSD/hf_home/
$ du -sh $HF_HOME
424M /mnt/C1000SSD/hf_home

$ hf cache ls
$ hf cache prune
$ hf cache rm model/gpt2
$ hf cache verify gpt2

$ find $HF_HOME -name "*.incomplete" -type f -delete

沒有留言:

張貼留言