# ValueError: The task `summarization_v2` is not supported by the pipeline. Supported tasks are: ['text-classification', 'token-classification', 'question-answering', 'summarization', 'translation', 'text-generation', 'zero-shot-classification', 'fill-mask', 'ner', 'sentiment-analysis']

- **ID:** `huggingface/pipeline-invalid-task`
- **Domain:** huggingface
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

The pipeline API was called with a task identifier that does not match any registered pipeline task, often due to typos or using a non-standard task name.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| transformers>=4.25.0 | active | — | — |
| huggingface-hub>=0.12.0 | active | — | — |

## Workarounds

1. **Correct the task name to a valid one: `from transformers import pipeline; pipe = pipeline('summarization', model='facebook/bart-large-cnn')`** (95% success)
   ```
   Correct the task name to a valid one: `from transformers import pipeline; pipe = pipeline('summarization', model='facebook/bart-large-cnn')`
   ```
2. **Use the model's default task by omitting the task argument: `pipe = pipeline(model='facebook/bart-large-cnn')` which auto-detects the task.** (90% success)
   ```
   Use the model's default task by omitting the task argument: `pipe = pipeline(model='facebook/bart-large-cnn')` which auto-detects the task.
   ```
3. **If the task is truly custom, register it with `from transformers.pipelines import SUPPORTED_TASKS; SUPPORTED_TASKS['custom_task'] = {...}`** (70% success)
   ```
   If the task is truly custom, register it with `from transformers.pipelines import SUPPORTED_TASKS; SUPPORTED_TASKS['custom_task'] = {...}`
   ```

## Dead Ends

- **Installing an older version of transformers (e.g., 4.20.0) to bypass the error** — Older versions have even fewer supported tasks; the invalid task will still fail. (80% fail)
- **Creating a custom pipeline with the same name without registering it** — The pipeline registry is static; custom tasks must be registered via `PipelineRegistry` or by using a valid alias. (90% fail)
- **Changing the model name in the pipeline call** — The error is about the task argument, not the model; changing the model does not affect task validation. (95% fail)
