Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
31b815d
Rename the feature extraction pipelines and remove question-answering
Rocketknight1 Jan 16, 2026
351b04c
make style
Rocketknight1 Jan 16, 2026
d470c01
Remove more refs to the question-answering pipelines
Rocketknight1 Jan 16, 2026
4a8c9b1
Remove more refs to the question-answering pipelines
Rocketknight1 Jan 16, 2026
3da828f
More migration guide
Rocketknight1 Jan 16, 2026
781bafe
make fix-repo
Rocketknight1 Jan 16, 2026
b5a48dc
Correct the name imports in init.py
Rocketknight1 Jan 16, 2026
5394bdd
Cleanup lots of refs to the pipelines
Rocketknight1 Jan 16, 2026
c4b711b
make fix-repo
Rocketknight1 Jan 16, 2026
8eaeb4a
Remove a bunch of doc refs too
Rocketknight1 Jan 16, 2026
043b848
Remove from not_doctested.txt
Rocketknight1 Jan 16, 2026
858b3ba
More cleanup of the QA pipelines
Rocketknight1 Jan 16, 2026
3ab9a01
More cleanup of the QA pipelines
Rocketknight1 Jan 16, 2026
f5ada93
Catch more examples in the docs
Rocketknight1 Jan 16, 2026
2fa432f
Catch more examples in the docs
Rocketknight1 Jan 16, 2026
ff17963
Remove refs to the argumenthandler too
Rocketknight1 Jan 16, 2026
19c12a8
A few more refs to fill-mask
Rocketknight1 Jan 16, 2026
dbcb665
Remove references in the pipeline model mappings
Rocketknight1 Jan 16, 2026
0bb8bd3
Remove references in the pipeline model mappings
Rocketknight1 Jan 16, 2026
ffec3a5
Apply suggestions from code review
Rocketknight1 Jan 19, 2026
647a4f5
FeatureExtractionPipelineTests -> EmbeddingPipelineTests
Rocketknight1 Jan 19, 2026
4b881a8
Change run_task_tests() calls
Rocketknight1 Jan 19, 2026
d2bb313
Restore fill_mask.py
Rocketknight1 Jan 21, 2026
04b263f
Restore fillmaskpipeline tests
Rocketknight1 Jan 21, 2026
c492967
make fix-repo
Rocketknight1 Jan 21, 2026
521c40c
Revert a few more bits
Rocketknight1 Jan 21, 2026
2e09093
Restore FillMaskPipeline in pipelines/__init__
Rocketknight1 Jan 22, 2026
4b67a21
Revert more fill-mask changes
Rocketknight1 Jan 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions MIGRATION_GUIDE_V5.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,11 @@ Linked PRs:

## Pipelines

`Text2TextGenerationPipeline`, as well as the related `SummarizationPipeline` and `TranslationPipeline`, were deprecated and will now be removed.
`pipeline` classes are intended as a high-level beginner-friendly API, but for almost all text-to-text tasks a modern chat model
and `TextGenerationPipeline` will provide much higher quality output. As a result, we felt it was misleading for beginners to offer the older pipelines.
### Text pipelines that should just be LLMs

`question-answering` and `Text2TextGenerationPipeline`, including its related `SummarizationPipeline` and `TranslationPipeline`, were deprecated and will now be removed. `pipeline` classes are intended as a high-level beginner-friendly API,
but for almost all text-to-text or question-answering tasks a modern chat model and `TextGenerationPipeline` will provide much higher quality output.
As a result, we felt it was misleading for beginners to offer the older pipelines.

If you were using these pipelines before, try using `TextGenerationPipeline` with a chat model instead. For example, for summarization:

Expand All @@ -630,9 +632,12 @@ message_history = [
print(summarizer(message_history)[0]["generated_text"][-1]["content"])
```

Similarly, the `image-to-text` pipeline has been removed. This pipeline was used for early image captioning models, but these
no longer offer competitive performance. Instead, for image captioning tasks we recommend using a modern vision-language chat model
via the `image-text-to-text` pipeline. For example:
The above example can be adapted for other tasks, e.g. translation or question answering, simply by changing the prompt.

### Vision pipelines that should just be VLMs

Similarly, the `image-to-text` and `visual-question-answering` pipelines have been removed. For image captioning or question answering
tasks we recommend using a modern vision-language chat model via the `image-text-to-text` pipeline. For example:

```python
import torch
Expand All @@ -655,6 +660,16 @@ message_history = [
print(captioner(message_history)[0]["generated_text"][-1]["content"])
```

The above example can be adapted for visual question answering simply by asking the question in the prompt.

### Other removed pipelines

The `image-to-image` pipeline has been removed, as it was rarely updated or used. For most image generation tasks, you
probably want [🤗 Diffusers](https://huggingface.co/docs/diffusers/index) instead!

### Other changes

- The `feature-extraction` pipeline has now been renamed to `text-embedding` and the `image-feature-extraction` pipeline has been renamed to `image-embedding`. The older names are still usable as aliases, so this should not impact your existing code.
- Image text to text pipelines will no longer accept images as a separate argument along with conversation chats. Image data has to be embedded in the chat's "content" field. See [#42359](https://github.com/huggingface/transformers/pull/42359)

## PushToHubMixin
Expand Down
2 changes: 0 additions & 2 deletions docs/source/en/internal/pipelines_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Most of those are only useful if you are studying the code of the models in the

[[autodoc]] pipelines.ZeroShotClassificationArgumentHandler

[[autodoc]] pipelines.QuestionAnsweringArgumentHandler

## Data format

[[autodoc]] pipelines.PipelineDataFormat
Expand Down
20 changes: 4 additions & 16 deletions docs/source/en/main_classes/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,6 @@ Pipelines available for natural language processing tasks include the following.
- __call__
- all

### QuestionAnsweringPipeline

[[autodoc]] QuestionAnsweringPipeline
- __call__
- all

### TableQuestionAnsweringPipeline

[[autodoc]] TableQuestionAnsweringPipeline
Expand Down Expand Up @@ -443,15 +437,15 @@ Pipelines available for multimodal tasks include the following.
- __call__
- all

### FeatureExtractionPipeline
### TextEmbeddingPipeline

[[autodoc]] FeatureExtractionPipeline
[[autodoc]] TextEmbeddingPipeline
- __call__
- all

### ImageFeatureExtractionPipeline
### ImageEmbeddingPipeline

[[autodoc]] ImageFeatureExtractionPipeline
[[autodoc]] ImageEmbeddingPipeline
- __call__
- all

Expand All @@ -473,12 +467,6 @@ Pipelines available for multimodal tasks include the following.
- __call__
- all

### VisualQuestionAnsweringPipeline

[[autodoc]] VisualQuestionAnsweringPipeline
- __call__
- all

## Parent class: `Pipeline`

[[autodoc]] Pipeline
2 changes: 1 addition & 1 deletion docs/source/en/pipeline_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Tailor the [`Pipeline`] to your task with task specific parameters such as addin

<Youtube id=tiZFewofSLM/>

Transformers has two pipeline classes, a generic [`Pipeline`] and many individual task-specific pipelines like [`TextGenerationPipeline`] or [`VisualQuestionAnsweringPipeline`]. Load these individual pipelines by setting the task identifier in the `task` parameter in [`Pipeline`]. You can find the task identifier for each pipeline in their API documentation.
Transformers has two pipeline classes, a generic [`Pipeline`] and many individual task-specific pipelines like [`TextGenerationPipeline`]. Load these individual pipelines by setting the task identifier in the `task` parameter in [`Pipeline`]. You can find the task identifier for each pipeline in their API documentation.

Each task is configured to use a default pretrained model and preprocessor, but this can be overridden with the `model` parameter if you want to use a different model.

Expand Down
2 changes: 0 additions & 2 deletions docs/source/ja/internal/pipelines_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ rendered properly in your Markdown viewer.

[[autodoc]] pipelines.ZeroShotClassificationArgumentHandler

[[autodoc]] pipelines.QuestionAnsweringArgumentHandler

## Data format

[[autodoc]] pipelines.PipelineDataFormat
Expand Down
20 changes: 4 additions & 16 deletions docs/source/ja/main_classes/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,6 @@ my_pipeline = pipeline(model="xxxx", pipeline_class=MyPipeline)

詳細については、[`TokenClassificationPipeline`] を参照してください。

### QuestionAnsweringPipeline

[[autodoc]] QuestionAnsweringPipeline
- __call__
- all

### TableQuestionAnsweringPipeline

[[autodoc]] TableQuestionAnsweringPipeline
Expand Down Expand Up @@ -445,15 +439,15 @@ my_pipeline = pipeline(model="xxxx", pipeline_class=MyPipeline)
- __call__
- all

### FeatureExtractionPipeline
### TextEmbeddingPipeline

[[autodoc]] FeatureExtractionPipeline
[[autodoc]] TextEmbeddingPipeline
- __call__
- all

### ImageFeatureExtractionPipeline
### ImageEmbeddingPipeline

[[autodoc]] ImageFeatureExtractionPipeline
[[autodoc]] ImageEmbeddingPipeline
- __call__
- all

Expand All @@ -463,12 +457,6 @@ my_pipeline = pipeline(model="xxxx", pipeline_class=MyPipeline)
- __call__
- all

### VisualQuestionAnsweringPipeline

[[autodoc]] VisualQuestionAnsweringPipeline
- __call__
- all

## Parent class: `Pipeline`

[[autodoc]] Pipeline
2 changes: 0 additions & 2 deletions docs/source/ko/internal/pipelines_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ rendered properly in your Markdown viewer.

[[autodoc]] pipelines.ZeroShotClassificationArgumentHandler

[[autodoc]] pipelines.QuestionAnsweringArgumentHandler

## 데이터 형식 [[transformers.PipelineDataFormat]]

[[autodoc]] pipelines.PipelineDataFormat
Expand Down
20 changes: 4 additions & 16 deletions docs/source/ko/main_classes/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,6 @@ my_pipeline = pipeline(model="xxxx", pipeline_class=MyPipeline)
- __call__
- all

### QuestionAnsweringPipeline [[transformers.QuestionAnsweringPipeline]]

[[autodoc]] QuestionAnsweringPipeline
- __call__
- all

### TableQuestionAnsweringPipeline [[transformers.TableQuestionAnsweringPipeline]]

[[autodoc]] TableQuestionAnsweringPipeline
Expand Down Expand Up @@ -410,15 +404,15 @@ my_pipeline = pipeline(model="xxxx", pipeline_class=MyPipeline)
- __call__
- all

### FeatureExtractionPipeline [[transformers.FeatureExtractionPipeline]]
### TextEmbeddingPipeline [[transformers.TextEmbeddingPipeline]]

[[autodoc]] FeatureExtractionPipeline
[[autodoc]] TextEmbeddingPipeline
- __call__
- all

### ImageFeatureExtractionPipeline [[transformers.ImageFeatureExtractionPipeline]]
### ImageEmbeddingPipeline [[transformers.ImageEmbeddingPipeline]]

[[autodoc]] ImageFeatureExtractionPipeline
[[autodoc]] ImageEmbeddingPipeline
- __call__
- all

Expand All @@ -434,12 +428,6 @@ my_pipeline = pipeline(model="xxxx", pipeline_class=MyPipeline)
- __call__
- all

### VisualQuestionAnsweringPipeline [[transformers.VisualQuestionAnsweringPipeline]]

[[autodoc]] VisualQuestionAnsweringPipeline
- __call__
- all

## Parent class: `Pipeline` [[transformers.Pipeline]]

[[autodoc]] Pipeline
2 changes: 0 additions & 2 deletions docs/source/zh/internal/pipelines_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ rendered properly in your Markdown viewer.

[[autodoc]] pipelines.ZeroShotClassificationArgumentHandler

[[autodoc]] pipelines.QuestionAnsweringArgumentHandler

## 数据格式

[[autodoc]] pipelines.PipelineDataFormat
Expand Down
20 changes: 4 additions & 16 deletions docs/source/zh/main_classes/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,6 @@ my_pipeline = pipeline(model="xxxx", pipeline_class=MyPipeline)

See [`TokenClassificationPipeline`] for all details.

### QuestionAnsweringPipeline

[[autodoc]] QuestionAnsweringPipeline
- __call__
- all

### TableQuestionAnsweringPipeline

[[autodoc]] TableQuestionAnsweringPipeline
Expand Down Expand Up @@ -419,15 +413,15 @@ See [`TokenClassificationPipeline`] for all details.
- __call__
- all

### FeatureExtractionPipeline
### TextEmbeddingPipeline

[[autodoc]] FeatureExtractionPipeline
[[autodoc]] TextEmbeddingPipeline
- __call__
- all

### ImageFeatureExtractionPipeline
### ImageEmbeddingPipeline

[[autodoc]] ImageFeatureExtractionPipeline
[[autodoc]] ImageEmbeddingPipeline
- __call__
- all

Expand All @@ -443,12 +437,6 @@ See [`TokenClassificationPipeline`] for all details.
- __call__
- all

### VisualQuestionAnsweringPipeline

[[autodoc]] VisualQuestionAnsweringPipeline
- __call__
- all

## Parent class: `Pipeline`

[[autodoc]] Pipeline
12 changes: 4 additions & 8 deletions src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@
"CsvPipelineDataFormat",
"DepthEstimationPipeline",
"DocumentQuestionAnsweringPipeline",
"FeatureExtractionPipeline",
"FillMaskPipeline",
"ImageClassificationPipeline",
"ImageFeatureExtractionPipeline",
"ImageEmbeddingPipeline",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to build on top of #42564 for getting modality-specific embeddings, just as a note (to myself)

"ImageSegmentationPipeline",
"ImageTextToTextPipeline",
"ImageToImagePipeline",
Expand All @@ -155,14 +154,13 @@
"PipedPipelineDataFormat",
"Pipeline",
"PipelineDataFormat",
"QuestionAnsweringPipeline",
"TableQuestionAnsweringPipeline",
"TextClassificationPipeline",
"TextEmbeddingPipeline",
"TextGenerationPipeline",
"TextToAudioPipeline",
"TokenClassificationPipeline",
"VideoClassificationPipeline",
"VisualQuestionAnsweringPipeline",
"ZeroShotAudioClassificationPipeline",
"ZeroShotClassificationPipeline",
"ZeroShotImageClassificationPipeline",
Expand Down Expand Up @@ -648,10 +646,9 @@
from .pipelines import CsvPipelineDataFormat as CsvPipelineDataFormat
from .pipelines import DepthEstimationPipeline as DepthEstimationPipeline
from .pipelines import DocumentQuestionAnsweringPipeline as DocumentQuestionAnsweringPipeline
from .pipelines import FeatureExtractionPipeline as FeatureExtractionPipeline
from .pipelines import FillMaskPipeline as FillMaskPipeline
from .pipelines import ImageClassificationPipeline as ImageClassificationPipeline
from .pipelines import ImageFeatureExtractionPipeline as ImageFeatureExtractionPipeline
from .pipelines import ImageEmbeddingPipeline as ImageEmbeddingPipeline
from .pipelines import ImageSegmentationPipeline as ImageSegmentationPipeline
from .pipelines import ImageTextToTextPipeline as ImageTextToTextPipeline
from .pipelines import ImageToImagePipeline as ImageToImagePipeline
Expand All @@ -663,14 +660,13 @@
from .pipelines import PipedPipelineDataFormat as PipedPipelineDataFormat
from .pipelines import Pipeline as Pipeline
from .pipelines import PipelineDataFormat as PipelineDataFormat
from .pipelines import QuestionAnsweringPipeline as QuestionAnsweringPipeline
from .pipelines import TableQuestionAnsweringPipeline as TableQuestionAnsweringPipeline
from .pipelines import TextClassificationPipeline as TextClassificationPipeline
from .pipelines import TextEmbeddingPipeline as TextEmbeddingPipeline
from .pipelines import TextGenerationPipeline as TextGenerationPipeline
from .pipelines import TextToAudioPipeline as TextToAudioPipeline
from .pipelines import TokenClassificationPipeline as TokenClassificationPipeline
from .pipelines import VideoClassificationPipeline as VideoClassificationPipeline
from .pipelines import VisualQuestionAnsweringPipeline as VisualQuestionAnsweringPipeline
from .pipelines import ZeroShotAudioClassificationPipeline as ZeroShotAudioClassificationPipeline
from .pipelines import ZeroShotClassificationPipeline as ZeroShotClassificationPipeline
from .pipelines import ZeroShotImageClassificationPipeline as ZeroShotImageClassificationPipeline
Expand Down
Loading