huggingface下载模型

📅 2026/7/6 13:36:23
huggingface下载模型
1.浏览器输入网址登录huggingface官网注册huggingface失败的请看https://www.cnblogs.com/Leonardo-li/p/19769436https://huggingface.co/2.创建access token首次创建access token需要先按照它的提示给注册邮箱发送连接通过邮箱中的链接地址跳转到hugging face官网后才可以创建access token3.下载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。[rootlocalhost lipengcheng]# hf auth login_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|To log in,huggingface_hubrequires 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 tokenbigmodelshas 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:bigmodels3.4 设置临时国内镜像加速exportHF_ENDPOINThttps://hf-mirror.com3.5 下载模型使用新版本命令hf downloadhf 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 验证模型下载结果[rootlocalhost ~]# 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