mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 16:17:57 +01:00
Fix streaming japanese/chinese characters
Credits to matasonic for the idea
This commit is contained in:
parent
5216117a63
commit
d183c7d29e
@ -32,6 +32,9 @@ async def _handle_connection(websocket, path):
|
|||||||
|
|
||||||
for a in generator:
|
for a in generator:
|
||||||
to_send = a[skip_index:]
|
to_send = a[skip_index:]
|
||||||
|
if to_send is None or chr(0xfffd) in to_send: # partial unicode character, don't send it yet.
|
||||||
|
continue
|
||||||
|
|
||||||
await websocket.send(json.dumps({
|
await websocket.send(json.dumps({
|
||||||
'event': 'text_stream',
|
'event': 'text_stream',
|
||||||
'message_num': message_num,
|
'message_num': message_num,
|
||||||
|
Loading…
Reference in New Issue
Block a user