huggingface / huggingface/diffusers
Any chance class members like self._interrupt could be defined in __init__ across pipelines?
- Lenguaje dominante
- Python
- Estrellas
- 34.5k
- Forks
- 7.3k
- Merge medio
- 3 d 3 h
- PR fusionados (30 d)
- 91
Descripción
### 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
Guía de contribución
Línea de trabajo
Comienza localizando WanImageToVideoPipeline y comparando su __init__, __call__ y interrupt property con las otras clases de pipeline mencionadas por el issue. Determina los pipelines afectados y verifica que interrupt se pueda comprobar inmediatamente después de la construcción; se considera terminado cuando los miembros relevantes están disponibles de forma coherente sin requerir una llamada previa.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- machine-learning
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100