ChatGLM2-6B: An Open Bilingual Chat LLM | 开源双语对话语言模型
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
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
Anything else?
No response