mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-09-20 18:45:09 +02:00
[extensions/openai] clip extra leading space (#2042)
This commit is contained in:
parent
3b886f9c9f
commit
ab08cf6465
1 changed files with 4 additions and 0 deletions
|
@ -520,6 +520,10 @@ class Handler(BaseHTTPRequestHandler):
|
|||
for a in generator:
|
||||
answer = a
|
||||
|
||||
# some reply's have an extra leading space to fit the instruction template, just clip it off from the reply.
|
||||
if edit_task[-1] != '\n' and answer and answer[0] == ' ':
|
||||
answer = answer[1:]
|
||||
|
||||
completion_token_count = len(encode(answer)[0])
|
||||
|
||||
resp = {
|
||||
|
|
Loading…
Reference in a new issue