1.浏览器输入网址,登录huggingface官网
- 注册huggingface失败的,请看:https://www.cnblogs.com/Leonardo-li/p/19769436
https://huggingface.co/
2.创建access token
- 首次创建access token需要先按照它的提示给注册邮箱发送连接,通过邮箱中的链接地址跳转到hugging face官网后,才可以创建access token
3.下载hugging face以及大模型
3.1 安装 huggingface_hub 库
pip3installhuggingface_hub3.2 将huggingface_hub升级到最新版本
pip3install--upgradehuggingface_hub3.3 登录 Hugging Face(可选,公开模型可跳过)
hf auth login- 按提示输入你的 Access Token ,询问是否添加为 git credential 时可按需选择 y 或 n,建议选择n。
[root@localhost lipengcheng]# hf auth login_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|To log in,`huggingface_hub`requires a token generated from https://huggingface.co/settings/tokens.Enter your token(input will not be visible): Add token asgitcredential?(Y/n)n Token is valid(permission: fineGrained). The token`bigmodels`has been saved to /root/.cache/huggingface/stored_tokens Your token has been saved to /root/.cache/huggingface/token Login successful. The current active token is:`bigmodels`3.4 设置临时国内镜像加速
exportHF_ENDPOINT=https://hf-mirror.com3.5 下载模型,使用新版本命令hf download
hf download Jackrong/Qwen3.5-9B-Claude-4.6-Opus-Reasoning-Distilled-v2 --local-dir ./Qwen3.5-9B-Claude-4.6-Opus-Reasoning-Distilled-v23.6 验证模型下载结果
[root@localhost ~]# ls -lh ./Qwen3.5-9B-Claude-4.6-Opus-Reasoning-Distilled-v2/total 18G -rw-r--r--1root root4.0K Mar2514:06 chat_template.jinja -rw-r--r--1root root3.4K Mar2514:06 config.json -rw-r--r--1root root5.0G Mar2514:58 model.safetensors-00001-of-00004.safetensors -rw-r--r--1root root5.0G Mar2514:56 model.safetensors-00002-of-00004.safetensors -rw-r--r--1root root5.1G Mar2515:00 model.safetensors-00003-of-00004.safetensors -rw-r--r--1root root3.1G Mar2514:53 model.safetensors-00004-of-00004.safetensors -rw-r--r--1root root 78K Mar2514:06 model.safetensors.index.json -rw-r--r--1root root1.3K Mar2514:06 processor_config.json -rw-r--r--1root root8.2K Mar2514:06 README.md -rw-r--r--1root root5.3K Mar2514:06 tokenizer_config.json -rw-r--r--1root root 20M Mar2514:07 tokenizer.json4.参考文档
https://blog.csdn.net/qq_69146676/article/details/157295084