Skip to content

Commit

Permalink
Fixed the Unicode logging issue in ooba_client.py
Browse files Browse the repository at this point in the history
Related:
#65 (comment)
  • Loading branch information
harlyh authored and chrisrude committed Jul 17, 2023
1 parent d1b1cfd commit 12038ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/oobabot/ooba_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ async def request_by_token(self, prompt: str) -> typing.AsyncIterator[str]:
) as websocket:
await websocket.send_json(request)
if self.log_all_the_things:
print(f"Sent request:\n{json.dumps(request, indent=1)}")
print(f"Prompt:\n{request['prompt']}")
print(f"Sent request:\n{json.dumps(request, indent=1).encode('utf-8')}")
print(f"Prompt:\n{request['prompt'].encode('utf-8')}")

async for msg in websocket:
# we expect a series of text messages in JSON encoding,
Expand Down

0 comments on commit 12038ff

Please sign in to comment.