# ValueError: The task `text-generation` is not supported by the pipeline for this model. Supported tasks are: ['feature-extraction', 'fill-mask', 'sentence-similarity', 'text-classification'].

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

## Root Cause

The pipeline is configured with a task that the model's architecture cannot perform, often because the model is an encoder-only type (e.g., BERT) but the task is decoder-only (e.g., text generation).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| transformers 4.36.0 | active | — | — |
| huggingface-hub 0.20.0 | active | — | — |
| Python 3.11 | active | — | — |

## Workarounds

1. **Use a model that supports the desired task. For text generation, use a decoder-only model like GPT-2: `pipeline('text-generation', model='gpt2')`. Check the model card on Hugging Face Hub for supported tasks.** (95% success)
   ```
   Use a model that supports the desired task. For text generation, use a decoder-only model like GPT-2: `pipeline('text-generation', model='gpt2')`. Check the model card on Hugging Face Hub for supported tasks.
   ```
2. **If you must use the current model, choose a supported task. For example, for BERT: `pipeline('text-classification', model='bert-base-uncased')`.** (90% success)
   ```
   If you must use the current model, choose a supported task. For example, for BERT: `pipeline('text-classification', model='bert-base-uncased')`.
   ```

## Dead Ends

- **** — BERT is an encoder-only model; it lacks a language modeling head for generation, so forcing the task will cause runtime errors or produce gibberish. (95% fail)
- **** — The error is about model-task compatibility, not library version; a newer version won't make BERT generate text. (70% fail)
