Skip to content

Cancel task functionality #18

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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