THUDM / ChatGLM2-6B

ChatGLM2-6B: An Open Bilingual Chat LLM | 开源双语对话语言模型
Other
15.74k stars 1.85k forks source link

调用API报错:ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read)) #548

Open Wisker566 opened 1 year ago

Wisker566 commented 1 year ago

Is there an existing issue for this?

Current Behavior

问题如题

Expected Behavior

No response

Steps To Reproduce

使用这个示例代码进行API调用就报错: import openai if name == "main": openai.api_base = "http://localhost:8000/v1" openai.api_key = "none" for chunk in openai.ChatCompletion.create( model="chatglm2-6b", messages=[ {"role": "user", "content": "你好"} ], stream=True ): if hasattr(chunk.choices[0].delta, "content"): print(chunk.choices[0].delta.content, end="", flush=True)

Environment

- OS:window
- Python:3.10
- Transformers:4.30.2
- PyTorch:11.7
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

Anything else?

No response

HaoliangZhou commented 1 year ago

遇到同样的问题,请问您解决了吗