国内使用git clone下载huggingfaceTOC
国内直接git clone连接不上问题
git clone https://huggingface.co/spaces/ZebangCheng/Emotion-LLaMA
Cloning into ‘Emotion-LLaMA’…
fatal: unable to access ‘https://huggingface.co/spaces/ZebangCheng/Emotion-LLaMA/’: Failed to connect to huggingface.co port 443: Connection timed out
需要替换为镜像地址clone:
git clone https://hf-mirror.com/spaces/ZebangCheng/Emotion-LLaMA
Cloning into ‘Emotion-LLaMA’…
remote: Enumerating objects: 352, done.
remote: Counting objects: 100% (347/347), done.
remote: Compressing objects: 100% (333/333), done.
remote: Total 352 (delta 117), reused 0 (delta 0), pack-reused 5 (from 1)
Receiving objects: 100% (352/352), 1.54 MiB | 3.09 MiB/s, done.
Resolving deltas: 100% (117/117), done.
Filtering content: 94% (16/17), 7.30 MiB | 3.41 MiB/s
自动下载中断问题
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘cas-bridge.xethub.hf-mirror.com’, port=443): Read timed out.
model-00001-of-00002.safetensors: 16%|█████████▊ | 1.55G/9.98G [12:05<1:05:40, 2.14MB/s]
临时设置超时时间为 300 秒(5 分钟),适用于当前终端会话
export TRANSFORMERS_OFFLINE=0
export HF_HUB_DOWNLOAD_TIMEOUT=300
export HUGGINGFACE_HUB_CACHE=/path/to/cache