System Info
Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.
transformers version: 5.2.0.dev0
- Platform: Linux-6.6.105+-x86_64-with-glibc2.35
- Python version: 3.12.12
- Huggingface_hub version: 1.3.7
- Safetensors version: 0.7.0
- Accelerate version: 1.12.0
- Accelerate config: not found
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.9.0+cpu (NA)
- Using distributed or parallel set-up in script?: parallel
Who can help?
@Rocketknight1
Information
Tasks
Reproduction
When calling transformers.pipeline() with an unknown task, the error message lists translation_XX_to_YY as an available task. However, in Transformers v5, the default pipeline() does not provide the "translation" pipeline in supported_tasks, so attempting to use translation_XX_to_YY leads to a KeyError: 'translation'.
Also, calling pipeline("translation") raises:
KeyError: "Invalid translation task translation, use 'translation_XX_to_YY' format"
but since "translation" is not actually supported, the expected error should be closer to:
KeyError: "Unknown task translation, available tasks are ..."
Colab link: https://colab.research.google.com/drive/1aKTGHuuDhpdxAJlJB8txOmcyAKeNoz2i?usp=sharing
Expected behavior
KeyError: "Unknown task hoge, available tasks are ['any-to-any', 'audio-classification', 'automatic-speech-recognition', 'depth-estimation', 'document-question-answering', 'feature-extraction', 'fill-mask', 'image-classification', 'image-feature-extraction', 'image-segmentation', 'image-text-to-text', 'image-to-image', 'keypoint-matching', 'mask-generation', 'ner', 'object-detection', 'question-answering', 'sentiment-analysis', 'table-question-answering', 'text-classification', 'text-generation', 'text-to-audio', 'text-to-speech', 'token-classification', 'video-classification', 'visual-question-answering', 'vqa', 'zero-shot-audio-classification', 'zero-shot-classification', 'zero-shot-image-classification', 'zero-shot-object-detection']
System Info
Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.
transformersversion: 5.2.0.dev0Who can help?
@Rocketknight1
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
When calling
transformers.pipeline()with an unknown task, the error message liststranslation_XX_to_YYas an available task. However, in Transformers v5, the defaultpipeline()does not provide the"translation"pipeline insupported_tasks, so attempting to usetranslation_XX_to_YYleads to aKeyError: 'translation'.Also, calling
pipeline("translation")raises:KeyError: "Invalid translation task translation, use 'translation_XX_to_YY' format"but since
"translation"is not actually supported, the expected error should be closer to:KeyError: "Unknown task translation, available tasks are ..."Colab link: https://colab.research.google.com/drive/1aKTGHuuDhpdxAJlJB8txOmcyAKeNoz2i?usp=sharing
Expected behavior
KeyError: "Unknown task hoge, available tasks are ['any-to-any', 'audio-classification', 'automatic-speech-recognition', 'depth-estimation', 'document-question-answering', 'feature-extraction', 'fill-mask', 'image-classification', 'image-feature-extraction', 'image-segmentation', 'image-text-to-text', 'image-to-image', 'keypoint-matching', 'mask-generation', 'ner', 'object-detection', 'question-answering', 'sentiment-analysis', 'table-question-answering', 'text-classification', 'text-generation', 'text-to-audio', 'text-to-speech', 'token-classification', 'video-classification', 'visual-question-answering', 'vqa', 'zero-shot-audio-classification', 'zero-shot-classification', 'zero-shot-image-classification', 'zero-shot-object-detection']