返回顶部
h

huggingfaceHugging Face管理

Manage models, datasets, Spaces, and repositories using Hugging Face CLI (hf). Supports authentication, upload, download, Space creation, and more.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.2
安全检测
已通过
829
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

huggingface

Hugging Face CLI 技能

使用 Hugging Face Hub CLI (hf) 执行各种操作。

环境变量

  • - HF_TOKEN:Hugging Face API 令牌(从 https://huggingface.co/settings/tokens 获取)

核心功能

1. 身份验证管理 (hf auth)

bash

检查登录状态


hf auth whoami

列出所有令牌

hf auth list

登录

hf auth login

登出

hf auth logout

切换令牌

hf auth switch

2. 模型管理 (hf models)

bash

列出模型(支持排序和筛选)


hf models ls --sort downloads --limit 10
hf models ls --search llama

获取模型信息

hf models info meta-llama/Llama-3.2-1B-Instruct

3. 数据集管理 (hf datasets)

bash

列出数据集


hf datasets ls --limit 10
hf datasets ls --search imagenet

获取数据集信息

hf datasets info HuggingFaceFW/fineweb

4. Spaces 管理 (hf spaces)

bash

列出 Spaces


hf spaces ls --limit 10

获取 Space 信息

hf spaces info username/repo-name

热重载(实验性功能,适用于 Gradio 6.1+)

hf spaces hot-reload username/repo-name app.py hf spaces hot-reload username/repo-name -f ./local/app.py

5. 仓库管理 (hf repos)

bash

创建新仓库


hf repos create my-model --type model
hf repos create my-dataset --type dataset
hf repos create my-space --type space

删除仓库

hf repos delete username/repo-name

设置为私有

hf repos settings username/repo-name --private

管理分支

hf repos branch create username/repo-name feature-branch hf repos branch delete username/repo-name feature-branch

管理标签

hf repos tag create username/repo-name v1.0 hf repos tag delete username/repo-name v1.0

移动仓库到其他命名空间

hf repos move old-namespace/my-model new-namespace/my-model

6. 下载文件 (hf download)

bash

下载整个模型


hf download meta-llama/Llama-3.2-1B-Instruct

下载特定文件

hf download meta-llama/Llama-3.2-1B-Instruct config.json tokenizer.json

使用通配符模式下载

hf download meta-llama/Llama-3.2-1B-Instruct --include *.safetensors hf download meta-llama/Llama-3.2-1B-Instruct --include .json --exclude .bin

下载到本地目录

hf download meta-llama/Llama-3.2-1B-Instruct --local-dir ./models/llama

下载数据集

hf download HuggingFaceM4/FineVision --repo-type dataset

7. 上传文件 (hf upload)

bash

上传整个目录


hf upload my-cool-model . .

上传单个文件

hf upload username/my-model ./models/model.safetensors

上传到数据集

hf upload username/my-dataset ./data /train --repo-type dataset

附带提交信息

hf upload username/my-model ./models . --commit-message=Epoch 34/50 --commit-description=Val accuracy: 68%

创建拉取请求

hf upload bigcode/the-stack . . --repo-type dataset --create-pr

创建私有仓库

hf upload username/my-private-model . . --private

8. 收藏集管理 (hf collections)

bash

创建收藏集


hf collections create My Models

向收藏集添加项目

hf collections add-item username/my-collection moonshotai/kimi-k2 model

列出收藏集

hf collections ls

获取收藏集信息

hf collections info username/my-collection

更新收藏集

hf collections update username/my-collection --title New Title

更新收藏集项目

hf collections update-item username/my-collection ITEMOBJECTID --note Updated note

删除项目

hf collections delete-item username/my-collection ITEMOBJECTID

删除收藏集

hf collections delete username/my-collection

使用示例

示例 1:下载和上传模型

bash

下载模型

hf download meta-llama/Llama-3.2-1B-Instruct --local-dir ./llama-model

上传到你的仓库

hf upload username/my-llama ./llama-model .

示例 2:管理 Space

bash

创建 Space

hf repos create my-app --type space

上传代码

hf upload username/my-app ./app.py

开发时热重载

hf spaces hot-reload username/my-app app.py

示例 3:批量操作

bash

下载所有 safetensors 文件

hf download meta-llama/Llama-3.2-1B-Instruct --include *.safetensors

上传并创建 PR

hf upload username/model . . --create-pr --commit-message=Update model

注意事项

  1. 1. 令牌管理:确保设置了 HF_TOKEN 环境变量,或使用 --token 参数
  2. 大文件上传:对于大文件夹,考虑使用 hf upload-large-folder
  3. Space 热重载:仅适用于 Gradio 6.1+,实验性功能
  4. 免费 Space 限制
- 免费固定 vCPU:2 - 内存:16GB - 无持久存储(使用外部存储或 HF 数据集)

资源

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 huggingface-1776295344 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 huggingface-1776295344 技能

通过命令行安装

skillhub install huggingface-1776295344

下载

⬇ 下载 huggingface v1.0.2(免费)

文件大小: 2.36 KB | 发布时间: 2026-4-16 18:02

v1.0.2 最新 2026-4-16 18:02
- Updated internal metadata in _meta.json.
- No user-facing or functional changes.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部