huggingface / optimum

🚀 Accelerate training and inference of 🤗 Transformers and 🤗 Diffusers with easy to use hardware optimization tools
https://huggingface.co/docs/optimum/main/
Apache License 2.0
2.53k stars 454 forks source link

Stable-diffusion is not a task, and should be handled as a model in the `TasksManager` #596

Open michaelbenayoun opened 1 year ago

michaelbenayoun commented 1 year ago

Feature request

As title says.

cc @echarlaix @fxmarty

Motivation

Make things more consistent and less misleading.

fxmarty commented 1 year ago

yes, for context: https://github.com/huggingface/optimum/pull/570#discussion_r1045939305

My understanding is that this choice is made because in the _TASKS_TO_AUTOMODELS mapping, we want to easily map stable-diffusion to StableDiffusionPipeline

If we were to use text-to-image as a task in _TASKS_TO_AUTOMODELS, there would be an issue: several classes can handle text-to-image, such as StableDiffusionPipeline from diffusers, but also eBart from transformers (dall-e).

fxmarty commented 1 year ago

@mht-sharma similar issue as with timm/transformers, as discussed in the PR

echarlaix commented 6 months ago

cc @IlyasMoutawwakil