概述

本文主要汇总HuggingFace和Modelscope常见用法和配置。

自定义缓存地址

1
2
export HF_HOME=/home/dataset-assist-0/hf-cache
export MODELSCOPE_CACHE=/home/dataset-assist-0/ms-cache

换源

1
2
export HF_ENDPOINT=https://hf-mirror.com
# Modelscope无需换源

缓存管理

1
2
3
4
#huggingface
hf cache scan #查看缓存占用情况
hf cache delete --dir <path-to-cache> #管理特定目录下的hf缓存
#todo:modelscope