Skip to content

Cancel task functionality #18

@irgolic

Description

@irgolic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions