minor fix

This commit is contained in:
Concedo 2024-11-01 22:42:57 +08:00
parent bbebc76817
commit 2a07f2dc2c
2 changed files with 3 additions and 3 deletions

View file

@ -1084,7 +1084,7 @@ def generate(genparams, is_quiet=False, stream_flag=False):
if pendingabortkey!="" and pendingabortkey==genkey:
print(f"\nDeferred Abort for GenKey: {pendingabortkey}")
pendingabortkey = ""
return {"text":"","status":-1,"stopreason":-1, "prompt_tokens":0, "completion_tokens": 0}
return {"text":"","status":-1,"stopreason":-1, "prompt_tokens":0, "completion_tokens": 0, "total_tokens": 0}
else:
ret = handle.generate(inputs)
outstr = ""
@ -1502,7 +1502,7 @@ class ServerRequestHandler(http.server.SimpleHTTPRequestHandler):
return generate(genparams=genparams,is_quiet=is_quiet,stream_flag=stream_flag)
genout = {"text": "", "status": -1, "stopreason": -1, "prompt_tokens":0, "completion_tokens": 0}
genout = {"text": "", "status": -1, "stopreason": -1, "prompt_tokens":0, "completion_tokens": 0, "total_tokens": 0}
if stream_flag:
loop = asyncio.get_event_loop()
executor = ThreadPoolExecutor()