huggingface / huggingface/diffusers
[design] adding a `validation` decorator
- 主要言語
- Python
- スター
- 34.5k
- フォーク
- 7.3k
- 平均マージ
- 3日 3時間
- マージ済み PR(30日)
- 91
説明
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.)
コントリビューションガイド
調査の方向性
PR #6573 の元の議論と、参照されている huggingface_hub/utils/_validators.py の実装から始めてください。ここで説明されている AttnProcessor、AttnProcessor2.0、IPAdapterProcessor のシグネチャの問題と、その decorator を比較してください。完了には、合意された設計と影響を受けるエントリポイントの明確化が必要ですが、この issue ではまだ指定されていません。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend-api-design
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100