国内快速下载huggingface模型

使用modelscope下载huggingface模型

https://modelscope.cn/models

设置国内镜像

export HF_ENDPOINT=https://hf-mirror.com

修改默认cache下载路径

export MODELSCOPE_CACHE=/root/volumes/modelscope

下载模型

from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

if __name__ == '__main__':
    # input = '程序员脱发用什么洗发水'
    model_id = '01ai/Yi-34B-Chat'
    pipe = pipeline(Tasks.text_generation, model=model_id)

    # 可以在 pipe 中输入 max_length, top_k, top_p, temperature 等生成参数
    # print(pipe(input, max_length=512))

下载单个pth文件

from modelscope.hub.file_download import model_file_download

model_dir = model_file_download(model_id='AI-ModelScope/rwkv-4-world',file_path='RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096.pth',revision='v1.0.0')
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值