worker_generate_stream "HTTP/1.1 503 Service Unavailable
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
def simple_chat(use_stream=True):
messages = [
{
"role": "system",
"content": "You are ChatGLM3, a large language model trained by Zhipu.AI. Follow the user's "
"instructions carefully. Respond using markdown.",
},
{
"role": "user",
"content": "你好,请你用生动的话语给我讲一个小故事吧"
}
]
response = client.chat.completions.create(
model="chatglm3-6b",
messages=messages,
stream=use_stream,
max_tokens=256,
temperature=0.8,
presence_penalty=1.1,
top_p=0.8)
if response:
if use_stream:
for chunk in response:
print(chunk.choices[0].delta.content)
else:
content = response.choices[0].message.content
print(content)
else:
print("Error:", response.status_code)
if __name__ == "__main__":
simple_chat(use_stream=False)
I use this code to test,if use_stream=false,it runs correctly,and if use_strem=true,the running result is none,at the same time the error information on web console is :
07:59:28 | INFO | stdout | INFO: 127.0.0.1:55831 - "POST /v1/chat/completions HTTP/1.1" 200 OK
2024-01-23 07:59:31 | INFO | httpx | HTTP Request: POST http://localhost:21002/worker_generate_stream "HTTP/1.1 503 Service Unavailable"
so where is the problem?thanks!
the python version is 3.10.13,fschat version is 0.2.35
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported Python example with stream set to false and true, then compare the /v1/chat/completions and /worker_generate_stream request logs. Use the fschat 0.2.35 and Python 3.10.13 details from the report to trace where the streaming path returns HTTP 503; done means identifying the cause and confirming a working streaming response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100