如何在huggingface上申请下载使用llama2/3模型

1. 在对应模型的huggingface页面上提交申请

搜索对应的模型型号

登录huggingface,在模型详情页面上,找到这个表单,填写内容,提交申请。需要使用梯子,country填写梯子的位置吧(比如美国)

等待一小时左右,会有邮件通知。

  1. 创建access token
    在huggingface上登录后,点击头像,选择setting,点击左侧的access tokens,新建一个token,注意勾选权限为llama3模型
    在这里插入图片描述
    然后复制token。注意,由于其只会出现一次,所以记得保存在其他安全的地方
    在这里插入图片描述
    3. 使用huggingface cli下载模型
1
2
pip install -U huggingface_hub

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

huggingface-cli download –resume-download 模型名称 –local-dir 存放模型的位置 –local-dir-use-symlinks False –resume-download –token token序列号xxxxxxx

比如

1
2
huggingface-cli download --resume-download meta-llama/Llama-2-7b-chat-hf --local-dir /data1/user/model/meta-llama/Llama-2-7b-chat-hf/ --local-dir-use-symlinks False --resume-download --token xxxxx

这样就可以下载好啦
在这里插入图片描述


如何在huggingface上申请下载使用llama2/3模型
https://abigail61.github.io/2024/11/23/原创-- 如何在huggingface上申请下载使用llama2-3模型/
作者
Yajing Luo
发布于
2024年11月23日
许可协议