huggingface / huggingface/diffusers
Any chance class members like self._interrupt could be defined in __init__ across pipelines?
- Vorherrschende Sprache
- Python
- Sterne
- 34.5k
- Forks
- 7.3k
- Ø Merge
- 3 T. 3 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### Describe the bug
I think there is no benefit to late initializing here and it puts a burden on the library user that could be easily avoided. Also leads to some confusion as it is uncommon, code inspection flags this. Let me know if I'm missing something.
### Reproduction
```
class WanImageToVideoPipeline:
def __init__(self):
pass
def __call__(self, *args, **kwargs):
self._interrupt = False
return 23
@property
def interrupt(self):
return self._interrupt
pipe = WanImageToVideoPipeline()
def on_async_user_abort_call_me_any_time():
# check if already interrupted but mid step
print(pipe.interrupt)
on_async_user_abort_call_me_any_time()
```
### Logs
```shell
AttributeError: 'WanImageToVideoPipeline' object has no attribute '_interrupt'. Did you mean: 'interrupt'?
```
### System Info
Diffusers 0.33.0.dev0, Linux, Python 3.10
### Who can help?
@yiyixuxu @DN6
Beitragsleitfaden
Rechercherichtung
Start by locating WanImageToVideoPipeline and comparing its __init__, __call__, and interrupt property with the other pipeline classes mentioned by the issue. Determine the affected pipelines and verify that interrupt can be checked immediately after construction; done means the relevant members are consistently available without requiring a prior call.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- machine-learning
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 52/100