Open yecllsl opened 10 months ago
运行python openai_api.py后,客户端运行Readme给的代码有误,报错requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read)) 。将stream=true改为false,正常返回,但报AttributeError: 'str' object has no attribute 'choices'错误。
No response
客户端运行Readme给的代码有误,报错requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read)) 。将stream=true改为false,正常返回,但报AttributeError: 'str' object has no attribute 'choices'错误。
- OS:Windows - Python:3.10 - Transformers:4.30.2 - PyTorch:2.1.0+cpu - CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :cpu
+1, 同样的问题。升级openai库到最新后, 报错 Data returned by API invalid for expected schema.
Data returned by API invalid for expected schema.
手动curl接口正常返回
找到了解决方法 首先制定版本pip install openai==0.28.0 然后按照issue修改代码即可
Is there an existing issue for this?
Current Behavior
运行python openai_api.py后,客户端运行Readme给的代码有误,报错requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read)) 。将stream=true改为false,正常返回,但报AttributeError: 'str' object has no attribute 'choices'错误。
Expected Behavior
No response
Steps To Reproduce
客户端运行Readme给的代码有误,报错requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read)) 。将stream=true改为false,正常返回,但报AttributeError: 'str' object has no attribute 'choices'错误。
Environment
Anything else?
No response