Skip to content

Cancel task functionality #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
irgolic opened this issue Oct 23, 2022 · 0 comments · Fixed by #29
Closed

Cancel task functionality #18

irgolic opened this issue Oct 23, 2022 · 0 comments · Fixed by #29

Comments

@irgolic
Copy link
Owner

irgolic commented Oct 23, 2022

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant