huggingface-transformers SKILL.md skillA

huggingface-transformers from znlgis/opengis-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add znlgis/opengis-skills/huggingface-transformers@git:20261015.5c73bb3

Pins git:20261015.5c73bb3 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
znlgis/opengis-skills
Path
ai/huggingface-transformers/SKILL.md
Versions recorded
1
Latest version
git:20261015.5c73bb3, committed Oct 15, 2026
Size
15,695 bytes
Repository stars
70
License
MIT

Use when running or fine-tuning Hugging Face Transformers models in Python — pipeline() inference for text classification and generation, loading weights with AutoModel/AutoTokenizer, device_map and dtype memory management, tokenizer usage, Trainer fine-tuning, and BGE embeddings for Chinese RAG. Covers transformers v5.x, PyTorch integration, and how its in-process inference differs from Ollama local deployment.

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

> **项目地址:** <https://github.com/huggingface/transformers>
>
> **官方文档:** <https://huggingface.co/docs/transformers/>
>
> **许可证:** Apache-2.0
> **最新版本:** v5.19.0(PyPI 与 GitHub Releases 双核实,截至 2026-10)

## 概述

Transformers 是 Hugging Face 开源的模型定义框架,为文本、视觉、音频与多模态模型提供统一的推理与训练接口。它把「配置、模型、预处理器」抽象为三类基类,并只用 `pipeline` 与 `Trainer` 两个 API 覆盖推理与微调两条主线。模型权重托管在 Hugging Face Hub,`from_pretrained()` 可按名称或路径自动下载并缓存。

- **AutoClass**:`AutoModel` / `AutoTokenizer` / `AutoModelForCausalLM` / `AutoModelForSequenceClassification` / `AutoModelForSeq2SeqLM` 等按任务自动推断架构
- **pipeline()**:任务级推理封装,一行完成预处理、前向与后处理
- **Trainer**:PyTorch 训练/评估循环,配合 `TrainingArguments` 配置超参
- **显存管理**:`device_map="auto"`、`dtype="auto"`、`BitsAndBytesConfig` 量化
- **生态**:`datasets`、`evaluate`、`accelerate`、`huggingface_hub`、`safetensors` 协同工作

Transformers 是库(进程内推理/训练),与 Ollama 这类独立推理服务定位不同,详见「最佳实践」。

---

## 环境准备

要求 Python >= 3.10(v5 起)。

```bash
# 核心:Transformers 与 PyTorch
pip install -U transformers torch

# 常用配套:数据集、评估指标、多设备调度
pip install -U datasets evaluate accelerate
```

可选 GPU 加速:

```bash
# NVIDIA CUDA(按显卡驱动选择 cu 版本,示例)
pip install torch --index-url https://download.pytorch.org/whl/cu124
```

量化推理(8bit/4bit)需额外安装:

```bash
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add znlgis/opengis-skills/huggingface-transformers@sha256:19b1348b45d02b7f

The line at the top of this page pins the label git:20261015.5c73bb3, 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.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_acnug6vfnyi7eqp4.svg)](https://markdownregistry.com/a/art_acnug6vfnyi7eqp4)

2 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 1 version of this file, committed on Oct 15, 2026.

versioncommittedcommitsizeaudit
git:20261015.5c73bb3 latest2026-10-15 5c73bb3 15,695 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (15695 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

GitHub

znlgis/opengis-skills · 70 stars · license MIT · pushed 2026-10-20 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_acnug6vfnyi7eqp4
GET https://markdownregistry.com/api/v1/resolve?ref=znlgis/opengis-skills/huggingface-transformers
GET https://markdownregistry.com/api/v1/blob/19b1348b45d02b7fa1bacf1ac337ed7e1b50070b949687a2e4a88a526b127043

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.

More from znlgis/opengis-skills

3d-skills SKILL.md skill
znlgis/opengis-skills · 3d/SKILL.md · Use when working with 3D Gaussian Splatting (3DGS), .ply model cleanup/compression/publishing, interactive 360-degree…
git:20261015.92a0ede · audit A · 70 stars
ara3d-sdk SKILL.md skill
znlgis/opengis-skills · 3d/ara3d-sdk/SKILL.md · Use when processing AEC/BIM 3D data in .NET 8 — mesh generation and transformation, SIMD-accelerated math, IFC/STEP/PLY…
git:20261015.5d0de0d · audit A · 70 stars
elements SKILL.md skill
znlgis/opengis-skills · 3d/elements/SKILL.md · Use when generating building information models (BIM) programmatically in C#/.NET — wall, beam, column, floor creation…
git:20261015.5d0de0d · audit A · 70 stars
open3d SKILL.md skill
znlgis/opengis-skills · 3d/open3d/SKILL.md · Use when processing 3D point clouds and meshes in Python — read/write PLY/PCD, voxel downsample, normal estimation…
git:20261015.5c73bb3 · audit A · 70 stars
opencsg-net SKILL.md skill
znlgis/opengis-skills · 3d/opencsg-net/SKILL.md · Use when doing constructive solid geometry (CSG) modeling in .NET — cube/sphere/cylinder primitives…
git:20261015.5d0de0d · audit A · 70 stars
photo-sphere-viewer SKILL.md skill
znlgis/opengis-skills · 3d/photo-sphere-viewer/SKILL.md · Use when displaying 360-degree panoramic images (equirectangular/cubemap/dual-fisheye) in web applications, building…
git:20261015.5d0de0d · audit B · 70 stars
supersplat SKILL.md skill
znlgis/opengis-skills · 3d/supersplat/SKILL.md · Use when editing 3D Gaussian Splatting (3DGS) .ply models in browser — cleanup noise/floaters, crop, transform…
git:20261015.0e107e3 · audit A · 70 stars
opengis-skills SKILL.md skill
znlgis/opengis-skills · SKILL.md · Use when AI coding assistant needs GIS/CAD/C#/AI/IoT/3D domain expertise. Index of 96 skills across 8 categories: gis…
git:20261015.92a0ede · audit A · 70 stars
ai-skills SKILL.md skill
znlgis/opengis-skills · ai/SKILL.md · Use when building LLM applications, RAG knowledge bases, AI agents, terminal coding agents, multi-model orchestration…
git:20261015.92a0ede · audit A · 70 stars
deepseek-harness SKILL.md skill
znlgis/opengis-skills · ai/deepseek-harness/SKILL.md · Use when building AI agent applications with a plugin-based architecture — Web UI, CLI, Python SDK, Cordis plugin…
git:20261015.0e107e3 · audit B · 70 stars
dify SKILL.md skill
znlgis/opengis-skills · ai/dify/SKILL.md · Use when building LLM applications with visual workflow — RAG knowledge bases, AI agents, chatbots with drag-and-drop…
git:20261015.0e107e3 · audit A · 70 stars
docutranslate SKILL.md skill
znlgis/opengis-skills · ai/docutranslate/SKILL.md · Use when translating documents locally via LLM — PDF, Word, Excel, Markdown, SRT subtitles with format preservation…
git:20261015.0e107e3 · audit B · 70 stars

Every file in znlgis/opengis-skills

Browse by kind, by grade A, or by owner.