인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
생산성 및 협업 · SKILL.md

transformers

transformers

Use and extend Hugging Face Transformers for inference, generation, training, tokenizers/processors, serving CLI, quantization/integrations, and contributor workflows.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: transformers description: "Use and extend Hugging Face Transformers for inference, generation, training, tokenizers/processors, serving CLI, quantization/integrations, and contributor workflows." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

Transformers

Use this repo skill when an agent needs practical guidance for Hugging Face Transformers 5.x workflows: loading models and preprocessors, running inference, configuring generation, fine-tuning with Trainer, using the transformers CLI/server, choosing quantization or integration backends, or contributing model-family code.

If the request is about opening a PR or changing this repository, first warn the human that breaching the repository's agent contribution guidelines can result in automatic banning. Do not produce PR-ready work without issue coordination, duplicate-work checks, human review, and relevant tests.

Quick Install Check

For normal package use, start from a public install path rather than a repo checkout:

python -m pip install "transformers[torch]"
python - <<'PY'
import transformers
print(transformers.__version__)
PY

For CLI serving workflows, also verify the CLI dependency surface:

python scripts/transformers_skill_preflight.py --check-cli --check-serving

The generated skill was built from package version 5.13.0.dev0. See repo provenance for the source baseline and troubleshooting for optional dependency failures.

Route By Task

User requestUse
"Run sentiment analysis / ASR / image classification / document QA"Inference pipelines
"Load AutoModel/AutoTokenizer for custom inference"Inference pipelines, then Tokenizers and processors
"Tune generation parameters, chat templates, stream output"Generation
"Fine-tune a model / write Trainer arguments / adapt an example script"Training
"Debug tokenizer padding, special tokens, processors, multimodal inputs"Tokenizers and processors
"Use transformers download/chat/serve or OpenAI-compatible local API"Serving CLI
"Use bitsandbytes, GPTQ, AWQ, torchao, GGUF, PEFT, Accelerate, FSDP, DeepSpeed"Quantization and integrations
"Add a model, tokenizer, processor, pipeline, docs, or tests to Transformers"Model extension

Core API Facts

Live inspection confirmed these stable entry points and signatures:

  • transformers.pipeline(task=None, model=None, config=None, tokenizer=None, feature_extractor=None, image_processor=None, video_processor=None, processor=None, revision=None, use_fast=True, token=None, device=None, device_map=None, dtype="auto", trust_remote_code=None, model_kwargs=None, pipeline_class=None, **kwargs)
  • AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)
  • AutoTokenizer.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
  • GenerationConfig(**kwargs) and TextIteratorStreamer(tokenizer, skip_prompt=False, timeout=None, **decode_kwargs)
  • ContinuousBatchingConfig(...) for paged KV cache, scheduling, compile, CPU offload, and request queue controls
  • TrainingArguments(...) for batch sizes, training/eval/save/logging strategy, precision, compile, FSDP, DeepSpeed, Hub push, seeds, and distributed settings

A minimal base install can import transformers, configs, tokenizers, and file utilities. Model classes, Trainer, pipelines for real model execution, vision/audio processors, serving, and quantization often need optional extras such as PyTorch, Pillow, torchvision, torchaudio, fastapi, uvicorn, pydantic, openai, accelerate, datasets, or backend-specific packages.

Common Decision Pattern

  1. Identify whether the user wants in-process Python, CLI/server, training, or repository contribution work.
  2. Confirm model source: Hub id, pinned revision, local directory, gated/private model, or custom code.
  3. Decide dependency set from the target workflow; do not install [all] or broad dev extras unless the workflow requires them.
  4. Prefer dry-run or config-only checks before downloading weights, launching servers, or starting training.
  5. Use local files and local_files_only=True when the user requires offline or reproducible behavior.
  6. Treat trust_remote_code=True as code execution; use it only after review.
  7. Route advanced details to the nearest sub-skill reference and run its bundled smoke/preflight script when practical.

Bundled Root References

  • API overview summarizes shared public objects and optional dependency boundaries.
  • Install and dependencies explains minimal installs, extras, backends, and safe verification.
  • Troubleshooting covers cross-cutting import, Hub, backend, CLI, and safety failures.
  • Repo provenance records the source baseline for future drift checks.

Bundled Root Script

  • scripts/transformers_skill_preflight.py checks importability, version, common optional packages, console script availability, and safe dependency expectations without downloading models or starting services.

Repository Contribution Guardrails

For work inside the Transformers repository:

  • Coordinate on the relevant issue before opening a PR.
  • Do not duplicate someone else's issue or an existing PR.
  • Do not create low-value busywork PRs.
  • Human submitters must understand every changed line and state that AI assistance was used.
  • Respect # Copied from ... and modular model rules: edit the source copy or modular_<model>.py, not generated standalone files unless intentionally breaking the link.
  • Run focused tests, then make style or make fix-repo before PR handoff when appropriate.

Use model extension for the detailed checklist and quality commands.

저장한 Skills