Unescape HTML in the chat API examples
This commit is contained in:
parent
439dd0faab
commit
e8c0c4990d
2 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
import asyncio
|
||||
import html
|
||||
import json
|
||||
import sys
|
||||
|
||||
|
@ -91,7 +92,7 @@ async def print_response_stream(user_input, history):
|
|||
async for new_history in run(user_input, history):
|
||||
cur_message = new_history['visible'][-1][1][cur_len:]
|
||||
cur_len += len(cur_message)
|
||||
print(cur_message, end='')
|
||||
print(html.unescape(cur_message), end='')
|
||||
sys.stdout.flush() # If we don't flush, we won't see tokens in realtime.
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue