-
Notifications
You must be signed in to change notification settings - Fork 30.8k
Open
Labels
Feature requestRequest for a new featureRequest for a new feature
Description
Feature request
Introduce transformers.prompt_templates — a YAML-based registry and accessor API:
from transformers import PromptTemplates
PromptTemplates.get("summarization") # "Summarize the following text:"
PromptTemplates.list_tasks() # ["summarization","vqa","ocr",...]
- Templates stored as yaml/json under src/transformers/prompt_templates/templates/.
- Accessor + validation in registry.py.
- Optional CLI command transformers-cli list-prompts.
- Pipelines can import a template by task name instead of hard-coding.
Motivation
Every pipeline and model today embeds its own prompt strings (e.g., summarization, OCR, VQA).
This duplication makes results inconsistent and hard to benchmark.
A central registry of task-specific prompt templates would unify defaults and enable easy community additions.
Your contribution
I’ll implement the registry module, add unit tests and docs, and migrate 1–2 pipelines (summarization / captioning) to use it.
Contributor: @Aki-07
Metadata
Metadata
Assignees
Labels
Feature requestRequest for a new featureRequest for a new feature