improve api concurrency performance
This commit is contained in:
parent
2ca8f5eba9
commit
b7fb8ed898
@ -93,6 +93,8 @@ The following is a coherent verbose detailed conversation between a girl named {
|
||||
|
||||
async def eval_rwkv():
|
||||
while completion_lock.locked():
|
||||
if await request.is_disconnected():
|
||||
return
|
||||
await asyncio.sleep(0.1)
|
||||
else:
|
||||
completion_lock.acquire()
|
||||
@ -185,8 +187,13 @@ async def completions(body: CompletionBody, request: Request):
|
||||
if model is None:
|
||||
raise HTTPException(status.HTTP_400_BAD_REQUEST, "model not loaded")
|
||||
|
||||
if body.prompt is None or body.prompt == "":
|
||||
raise HTTPException(status.HTTP_400_BAD_REQUEST, "prompt not found")
|
||||
|
||||
async def eval_rwkv():
|
||||
while completion_lock.locked():
|
||||
if await request.is_disconnected():
|
||||
return
|
||||
await asyncio.sleep(0.1)
|
||||
else:
|
||||
completion_lock.acquire()
|
||||
|
Loading…
Reference in New Issue
Block a user