fix: unicode decoding (#702)

This commit is contained in:
Anchen 2024-04-22 01:58:23 +10:00 committed by GitHub
parent 1484598de1
commit 749cabf299
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -338,7 +338,6 @@ class APIHandler(BaseHTTPRequestHandler):
) )
break break
detokenizer.finalize()
new_text = detokenizer.last_segment new_text = detokenizer.last_segment
response = self.generate_response(new_text, None) response = self.generate_response(new_text, None)
self.wfile.write(f"data: {json.dumps(response)}\n\n".encode()) self.wfile.write(f"data: {json.dumps(response)}\n\n".encode())
@ -347,7 +346,6 @@ class APIHandler(BaseHTTPRequestHandler):
# check is there any remaining text to send # check is there any remaining text to send
if stop_sequence_buffer: if stop_sequence_buffer:
detokenizer.finalize()
next_chunk = ( next_chunk = (
detokenizer.last_segment detokenizer.last_segment
if stop_sequence_suffix is None if stop_sequence_suffix is None