huggingface-dataset-publishing SKILL.md skillA
huggingface-dataset-publishing from black-yt/skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add black-yt/skills/huggingface-dataset-publishing@git:20260605.e763408Pins git:20260605.e763408 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- black-yt/skills
- Path
huggingface-dataset-publishing/SKILL.md- Versions recorded
- 2
- Latest version
- git:20260605.e763408, committed Jun 5, 2026
- First version recorded
- May 27, 2026
- Size
- 9,848 bytes
- Repository stars
- 16
- License
- none declared
当需要创建、上传、验证和维护 Hugging Face Dataset 时使用,尤其是包含图片、多图字段、文本步骤、答案、JSON/metadata 字段的数据集;包括 datasets Features/Image/Sequence 的规范用法、push_to_hub、上传后 load_dataset 回读验证、Dataset Viewer 图片浏览检查、clone dataset repo 后用 git 维护 README/dataset card,以及 token 安全。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Hugging Face Dataset Publishing
## 核心原则
- 不要把 Hugging Face token 写进代码、notebook、README、日志或 git history;使用 `HF_TOKEN` 环境变量或 `huggingface-cli login`。
- 图片字段必须用 `datasets.Image` 特征类型,不要只上传本地图片路径字符串;多图字段用 `Sequence(Image())`。
- 上传前先本地构造 `Dataset`/`DatasetDict` 并检查 `features`、样本、图片解码和 JSON 字段。
- 上传后必须用 `load_dataset` 从 Hub 回读验证,确认图片能解码、metadata 可解析、split/config 正确。
- 上传完成后建议 `git clone https://huggingface.co/datasets/<org>/<repo>` 到本地,用 git 维护 `README.md`、dataset card、示例和后续小改动。
- 大数据或大量图片不要随手放在当前目录;明确构建目录、清理临时样本,不把 token、缓存或中间碎片提交。
如果用户贴出了明文 HF token,提醒其撤销/轮换该 token,并在后续代码中改用环境变量。
## 依赖与登录
安装依赖:
```bash
python -m pip install -U datasets huggingface_hub pillow
```
推荐登录方式:
```bash
export HF_TOKEN="hf_xxx"
huggingface-cli login --token "$HF_TOKEN"
```
Python 中只从环境变量读取:
```python
import os
from huggingface_hub import login
token = os.environ.get("HF_TOKEN")
if token:
login(token=token)
```
## 源码追溯
- `datasets` 和 `huggingface_hub` 版本更新较快;当 `Features`、`Image`、`Sequence`、`push_to_hub` 或 `load_dataset` 行为不符合预期时,优先查看当前安装版本源码。
- `module.__file__` 可定位安装路径。
- `inspect.getsource(...)` 可查看函数、类或方法实现。
- 源码只用于阅读和定位问题,不要改源码,不要直接修改 `site-packages`;需要修改依赖时先征得用户同意。
```bash
…Read the whole file at its exact version.
How to install
mdr add black-yt/skills/huggingface-dataset-publishing@sha256:5a9a572dea773dd8The line at the top of this page pins the label git:20260605.e763408, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_ewo4rrfoizd5aj4k)
3 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 2 versions of this file, between May 27, 2026 and Jun 5, 2026, about one every 9 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260605.e763408 latest | 2026-06-05 | e763408 | 9,848 B | A | view · diff |
| git:20260527.f1fd14e | 2026-05-27 | f1fd14e | 8,706 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (9848 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
black-yt/skills · 16 stars · license none declared · pushed 2026-11-05 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_ewo4rrfoizd5aj4k GET https://markdownregistry.com/api/v1/resolve?ref=black-yt/skills/huggingface-dataset-publishing GET https://markdownregistry.com/api/v1/blob/5a9a572dea773dd8b1d1e769275dd02bb5b57eae653bac4ffe8a8e3df4e8d701
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.