huggingface / huggingface/diffusers
[design] adding a `validation` decorator
- Vorherrschende Sprache
- Python
- Sterne
- 34.5k
- Forks
- 7.3k
- Ø Merge
- 3 T. 3 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
We try to avoid using the `kwargs` argument at diffusers because it's error prone and makes our code less readable. However, there are some instances where a fixed signature might not be practical. For example, our default attention processor class `AttnProcessor/AttnProcessor2.0` can now be used in conjunction with other attention processors such as `IPAdapterProcessor`. If we need to pass a new argument to `IPAdapterProcessor`, we will need to add it to the `AttnProcessor`'s signature as well. It may be worthwhile to consider adding a `validation` decorator https://github.com/huggingface/huggingface_hub/blob/c528f78fa7404869f32a2b04eac0f9964a5c6f9e/src/huggingface_hub/utils/_validators.py#L46 for this use case
(Original discussion can be found here: https://github.com/huggingface/diffusers/pull/6573#discussion_r1463072069.)
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit der ursprünglichen Diskussion in PR #6573 und der referenzierten Implementierung in huggingface_hub/utils/_validators.py. Vergleichen Sie diesen Decorator mit dem hier beschriebenen Signaturproblem von AttnProcessor, AttnProcessor2.0 und IPAdapterProcessor; für die Erledigung sind ein abgestimmtes Design und klare betroffene Einstiegspunkte erforderlich, die in diesem Issue noch nicht festgelegt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- backend-api-design
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100