TypeError: unsupported operand type(s) for |: 'dict' and 'dict'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
My code use to work with fschat==0.2.33 and vllm==0.2.2, but when I migrated to new versions (fschat==0.2.34 and vllm==0.2.6) fastchat is throwing the following error ,
logs from fastchat
`| ERROR | stderr | File "/usr/local/lib/python3.8/dist-packages/fastchat/serve/vllm_worker.py", line 150, in generate_stream
| ERROR | stderr | yield (json.dumps(ret | {"finish_reason": None}) + "\0").encode()
| ERROR | stderr | TypeError: unsupported operand type(s) for |: 'dict' and 'dict'
logs from vLLM code
Received request 24bc821beced4a0abf40ac7342134701
Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 0.0 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 1.9%, CPU KV cache usage: 0.0%
Finished request 24bc821beced4a0abf40ac7342134701.
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
Start at fastchat/serve/vllm_worker.py line 150 and inspect the generate_stream path that combines ret with the finish-reason field. Reproduce the failure with Python 3.8 and the reported fschat and vllm versions, then verify the behavior with the supported versions. Done means the request completes without this TypeError or the required Python compatibility is clearly identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100