Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError #4

Open
solstice-gao opened this issue May 30, 2023 · 1 comment
Open

UnicodeDecodeError #4

solstice-gao opened this issue May 30, 2023 · 1 comment

Comments

@solstice-gao
Copy link

image

prompt = "用中文回答:请帮我写一个判断字符串是否为空的方法"

Full Response

/Users/ga666666/PycharmProjects/baichat/venv/bin/python /Users/ga666666/PycharmProjects/baichat/baichat.py 
当
字符串
为空
时
,
通
常
指
字符串
的
长度
为
零
或
者
字符串
只
包
含
空
格
字符
。
以下
是
一个
于
判断
字符串
为空
的
方法
的
示
例
代码
:


Exception ignored from cffi callback <function write_callback at 0x10d522ac0>:
Traceback (most recent call last):
  File "/Users/ga666666/PycharmProjects/baichat/venv/lib/python3.11/site-packages/curl_cffi/curl.py", line 53, in write_callback
    callback(ffi.buffer(ptr, nmemb)[:])
  File "/Users/ga666666/PycharmProjects/baichat/venv/lib/python3.11/site-packages/baichat_py/__init__.py", line 80, in handle_stream_response
    Completion.message_queue.put(response.decode("utf-8"))
                                 ^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe7 in position 1359: unexpected end of data
Exception in thread Thread-1 (request):
Traceback (most recent call last):
  File "/Users/ga666666/PycharmProjects/baichat/venv/lib/python3.11/site-packages/curl_cffi/requests/session.py", line 428, in request
    c.perform()
  File "/Users/ga666666/PycharmProjects/baichat/venv/lib/python3.11/site-packages/curl_cffi/curl.py", line 191, in perform
    self._check_error(ret, action="perform")
  File "/Users/ga666666/PycharmProjects/baichat/venv/lib/python3.11/site-packages/curl_cffi/curl.py", line 84, in _check_error
    raise error
curl_cffi.curl.CurlError: Failed to perform, ErrCode: 23, Reason: 'Failure writing output to destination'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/ga666666/PycharmProjects/baichat/venv/lib/python3.11/site-packages/baichat_py/__init__.py", line 55, in request
    response = requests.post("https://chatbot.theb.ai/api/chat-process", headers=headers, data=payload, impersonate="chrome101", content_callback=Completion.handle_stream_response, proxies=proxies)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ga666666/PycharmProjects/baichat/venv/lib/python3.11/site-packages/curl_cffi/requests/__init__.py", line 46, in request
    return s.request(
           ^^^^^^^^^^
  File "/Users/ga666666/PycharmProjects/baichat/venv/lib/python3.11/site-packages/curl_cffi/requests/session.py", line 430, in request
    raise RequestsError(e)
curl_cffi.requests.errors.RequestsError: Failed to perform, ErrCode: 23, Reason: 'Failure writing output to destination'

@0xMRTT
Copy link
Member

0xMRTT commented Jun 4, 2023

Will release a new version with a fix for that in a few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants