As runner_service is implemented with huggingface pipelines, this is dependent on huggingface/diffusers#374 being resolved.
That said, pipeline callbacks just got merged (huggingface/diffusers#521). It should be possible to stop the pipeline somehow from a callback.
Fulfiling this PR means to:
- add
DEL /task/{task_id} endpoint
- on every step (in pipeline callback), poll to see if it's been cancelled
- if so, stop image generation, and send
AbortedEvent(reason="cancelled"), unless generation had just finished, in which case send a FinishedEvent anyway
As
runner_serviceis implemented with huggingface pipelines, this is dependent on huggingface/diffusers#374 being resolved.That said, pipeline callbacks just got merged (huggingface/diffusers#521). It should be possible to stop the pipeline somehow from a callback.
Fulfiling this PR means to:
DEL /task/{task_id}endpointAbortedEvent(reason="cancelled"), unless generation had just finished, in which case send aFinishedEventanyway