summaryrefslogtreecommitdiffstats
path: root/testing/binghuan/helpers/binghuan.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/binghuan/helpers/binghuan.py')
-rw-r--r--testing/binghuan/helpers/binghuan.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/testing/binghuan/helpers/binghuan.py b/testing/binghuan/helpers/binghuan.py
index 2aabc4b6..203bbe45 100644
--- a/testing/binghuan/helpers/binghuan.py
+++ b/testing/binghuan/helpers/binghuan.py
@@ -210,10 +210,12 @@ async def run(optionSets, messages):
prompt = messages[-1]['content']
if(len(messages) > 1):
prompt = convert(messages)
- async for value in AsyncCompletion.create(prompt=prompt,
- optionSets=optionSets):
-
- print(value, flush=True, end = '')
+ async for value in AsyncCompletion.create(prompt=prompt, optionSets=optionSets):
+ try:
+ print(value, flush=True, end='')
+ except UnicodeEncodeError as e:
+ # emoji encoding problem
+ print(value.encode('utf-8'), flush=True, end='')
optionSet = conversationstyles[config['model']]
asyncio.run(run(optionSet, config['messages'])) \ No newline at end of file