Closed hziwei closed 1 year ago
How about trying to modify the file "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 442? open_timeout: Optional[float] = 30,#10 ping_interval: Optional[float] = 20,#20 ping_timeout: Optional[float] = 30,#20
to set them bigger.
试了一下 https://github.com/acheong08/EdgeGPT/pull/610 这个PR可以修复
Traceback (most recent call last): File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 662, in __await_impl__ await protocol.handshake( File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 329, in handshake raise InvalidStatusCode(status_code, response_headers) websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 200
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 655, in await_impl_timeout return await self.await_impl() File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 676, in await_impl await protocol.wait_closed() asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/ecs-user/main.py", line 37, in
ddd=asyncio.run(main())
File "/home/ecs-user/anaconda3/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/home/ecs-user/anaconda3/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/home/ecs-user/main.py", line 10, in main
async for final, data in e:
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/EdgeGPT/EdgeGPT.py", line 181, in ask_stream
async for response in self.chat_hub.ask_stream(
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/EdgeGPT/chathub.py", line 102, in ask_stream
async with connect(
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 637, in aenter
return await self
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 655, in await_impl_timeout
return await self.await_impl__()
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/async_timeout.py", line 169, in aexit__
self._do_exit(exc_type)
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/async_timeout.py", line 252, in _do_exit
raise asyncio.TimeoutError