KEMBAR78
asyncio.exceptions.TimeoutError in Colab · Issue #25 · GiusTex/EdgeGPT · GitHub
Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.
This repository was archived by the owner on Oct 2, 2023. It is now read-only.

asyncio.exceptions.TimeoutError in Colab #25

@mrdc

Description

@mrdc

Hello,

When running Hey Bing, I get asyncio.exceptions.TimeoutError in EdgeGPT() func, which awaits bot.ask().
Are there some sort of hardcoded timeout?

P.S. script.py was edited to fix the conda issue in Colab, so line numbers will differ, compared to original script.py ;)

Log:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/websockets/legacy/client.py", line 662, in __await_impl__
    await protocol.handshake(
  File "/usr/local/lib/python3.10/dist-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 "/usr/local/lib/python3.10/dist-packages/websockets/legacy/client.py", line 655, in __await_impl_timeout__
    return await self.__await_impl__()
  File "/usr/local/lib/python3.10/dist-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 "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 427, in run_predict
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1323, in process_api
    result = await self.call_function(
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1067, in call_function
    prediction = await utils.async_iteration(iterator)
  File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 336, in async_iteration
    return await iterator.__anext__()
  File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 329, in __anext__
    return await anyio.to_thread.run_sync(
  File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 312, in run_sync_iterator_async
    return next(iterator)
  File "/content/text-generation-webui/modules/chat.py", line 305, in generate_chat_reply_wrapper
    for i, history in enumerate(generate_chat_reply(text, state, regenerate, _continue, loading_message=True)):
  File "/content/text-generation-webui/modules/chat.py", line 290, in generate_chat_reply
    for history in chatbot_wrapper(text, state, regenerate=regenerate, _continue=_continue, loading_message=loading_message):
  File "/content/text-generation-webui/modules/chat.py", line 206, in chatbot_wrapper
    prompt = apply_extensions('custom_generate_chat_prompt', text, state, **kwargs)
  File "/content/text-generation-webui/modules/extensions.py", line 208, in apply_extensions
    return EXTENSION_MAP[typ](*args, **kwargs)
  File "/content/text-generation-webui/modules/extensions.py", line 86, in _apply_custom_generate_chat_prompt
    return extension.custom_generate_chat_prompt(text, state, **kwargs)
  File "/content/text-generation-webui/extensions/EdgeGPT/script.py", line 222, in custom_generate_chat_prompt
    asyncio.run(EdgeGPT())
  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 646, in run_until_complete
    return future.result()
  File "/content/text-generation-webui/extensions/EdgeGPT/script.py", line 196, in EdgeGPT
    response = await bot.ask(prompt=UserInput, conversation_style=style, simplify_response=True)
  File "/usr/local/lib/python3.10/dist-packages/EdgeGPT/EdgeGPT.py", line 116, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "/usr/local/lib/python3.10/dist-packages/EdgeGPT/chathub.py", line 102, in ask_stream
    async with connect(
  File "/usr/local/lib/python3.10/dist-packages/websockets/legacy/client.py", line 637, in __aenter__
    return await self
  File "/usr/local/lib/python3.10/dist-packages/websockets/legacy/client.py", line 654, in __await_impl_timeout__
    async with asyncio_timeout(self.open_timeout):
  File "/usr/local/lib/python3.10/dist-packages/websockets/legacy/async_timeout.py", line 169, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.10/dist-packages/websockets/legacy/async_timeout.py", line 252, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions