shroominic / codeinterpreter-api

👾 Open source implementation of the ChatGPT Code Interpreter
https://discord.gg/Vaq25XJvvW
MIT License
3.79k stars 402 forks source link

asyncio.exceptions.TimeoutError #86

Closed nick917 closed 1 year ago

nick917 commented 1 year ago

Hi Shroominic,

I tried the 2 example in readme (bitcoin and iris plot) but got asyncio Timeout error. I have tested gp4 and gpt3.5 api but same error.

Thanks

nick917 commented 1 year ago

In case someone is still bothered by this issue, it happens on gpu support machine/node. It works on cpu only.

paulmis commented 1 year ago

@nick917 @shroominic for me this happens on an AWS CPU instance?

OS: Ubuntu 20.04.6 LTS x86_64
Host: t3.large
Kernel: 5.15.0-1041-aws
Uptime: 13 days, 3 hours, 1 min
Packages: 809 (dpkg), 6 (snap)
Shell: bash 5.0.17
Terminal: /dev/pts/0
CPU: Intel Xeon Platinum 8175M (2) @ 2.499GHz
GPU: 00:03.0 Amazon.com, Inc. Device 1111
Memory: 227MiB / 7836MiB

Full trace:

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.10/site-packages/websockets/legacy/client.py", line 655, in __await_impl_timeout__
    return await self.__await_impl__()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/websockets/legacy/client.py", line 662, in __await_impl__
    await protocol.handshake(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/websockets/legacy/client.py", line 323, in handshake
    status_code, response_headers = await self.read_http_response()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/websockets/legacy/client.py", line 139, in read_http_response
    status_code, reason, headers = await read_response(self.reader)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/websockets/legacy/http.py", line 120, in read_response
    status_line = await read_line(stream)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/websockets/legacy/http.py", line 194, in read_line
    line = await stream.readline()
  File "/usr/lib/python3.10/asyncio/streams.py", line 524, in readline
    line = await self.readuntil(sep)
  File "/usr/lib/python3.10/asyncio/streams.py", line 616, in readuntil
    await self._wait_for_data('readuntil')
  File "/usr/lib/python3.10/asyncio/streams.py", line 501, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/ci.py", line 26, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/ubuntu/ci.py", line 7, in main
    await session.astart()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/codeinterpreterapi/session.py", line 87, in astart
    status = SessionStatus.from_codebox_status(await self.codebox.astart())
  File "/home/ubuntu/.local/lib/python3.10/site-packages/codeboxapi/box/localbox.py", line 187, in astart
    await self._aconnect()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/codeboxapi/box/localbox.py", line 199, in _aconnect
    self.ws = await ws_connect(f"{self.ws_url}/kernels/{self.kernel_id}/channels")
  File "/home/ubuntu/.local/lib/python3.10/site-packages/websockets/legacy/client.py", line 654, in __await_impl_timeout__
    async with asyncio_timeout(self.open_timeout):
  File "/home/ubuntu/.local/lib/python3.10/site-packages/websockets/legacy/async_timeout.py", line 169, in __aexit__
    self._do_exit(exc_type)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/websockets/legacy/async_timeout.py", line 252, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
/home/ubuntu/.local/lib/python3.10/site-packages/codeboxapi/box/localbox.py:512: RuntimeWarning: coroutine 'Process.wait' was never awaited