使用镜像快速下载huggingface上模型

pip install huggingface-cli -i https://pypi.tuna.tsinghua.edu.cn/simple

 

import os

# 设置镜像,快速下载
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'

# 下载模型
os.system('huggingface-cli download --resume-download google/flan-t5-xl --local-dir ./flan-t5-xl')

posted @ 2024-07-05 16:25  singyoutosleep  阅读(96)  评论(0编辑  收藏  举报