MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / cancel

Method cancel

examples/server/server.py:15595–15605  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15593 request.on_error = on_error
15594
15595 def cancel() -> None:
15596 if cancelled.is_set():
15597 return
15598 cancelled.set()
15599 try:
15600 def cancel_request() -> None:
15601 self.scheduler.cancel(request.id)
15602
15603 self.enqueue(cancel_request)
15604 except RuntimeError:
15605 pass
15606
15607 def stream() -> CompletionStream:
15608 try:

Callers 5

cancel_requestMethod · 0.45
stream_sse_chunksFunction · 0.45
stream_sse_outputsFunction · 0.45

Calls 1

enqueueMethod · 0.95

Tested by

no test coverage detected