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

Method admit_waiting

examples/server/server.py:13518–13527  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

13516 return max_batch_size is None or draft_batch_size <= max_batch_size
13517
13518 def admit_waiting(self) -> None:
13519 while self.pending_requests:
13520 request = self.pending_requests[0]
13521 if request.cancelled:
13522 self.fail_request(request, CompletionRequestCancelledError("request cancelled"))
13523 continue
13524 if not self.can_admit(request):
13525 break
13526 self.pending_requests.popleft()
13527 self.admit_request(request)
13528
13529 def can_admit(self, request: CompletionRequest) -> bool:
13530 return self.memory_policy.can_admit(request)

Callers 1

stepMethod · 0.95

Calls 4

fail_requestMethod · 0.95
can_admitMethod · 0.95
admit_requestMethod · 0.95

Tested by

no test coverage detected