Gradio in colabs not running - same code locally works fine

Hi there,
i`ve got a litte Bot using the openai-API and gradio that I would like to get running via google colabs. Everything is working fine locally. The same code in colabs just wound run. I pip installes gradio (and upgraded…just to be sure) and openai.
The gradio ChatInterface appears but as soon as I am trying to send a message to the bot I get stuck. Debug-Mode gives the following output.:

Colab notebook detected. This cell will run indefinitely so that you can see errors and logs. To turn off, set debug=False in launch().
Note: opening Chrome Inspector may crash demo inside Colab notebooks.

To create a public link, set share=True in launch().

Running on https://localhost:7860/

ERROR: Exception in ASGI application
Traceback (most recent call last):
File “/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/”, line 408, in run_asgi
result = await app( # type: ignore[func-returns-value]
File “/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/”, line 84, in call
return await, receive, send)
File “/usr/local/lib/python3.10/dist-packages/fastapi/”, line 1106, in call
await super().call(scope, receive, send)
File “/usr/local/lib/python3.10/dist-packages/starlette/”, line 122, in call
await self.middleware_stack(scope, receive, send)
File “/usr/local/lib/python3.10/dist-packages/starlette/middleware/”, line 184, in call
raise exc
File “/usr/local/lib/python3.10/dist-packages/starlette/middleware/”, line 162, in call
await, receive, _send)
File “/usr/local/lib/python3.10/dist-packages/starlette/middleware/”, line 91, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File “/usr/local/lib/python3.10/dist-packages/starlette/middleware/”, line 146, in simple_response
await, receive, send)
File “/usr/local/lib/python3.10/dist-packages/starlette/middleware/”, line 79, in call
raise exc
File “/usr/local/lib/python3.10/dist-packages/starlette/middleware/”, line 68, in call
await, receive, sender)
File “/usr/local/lib/python3.10/dist-packages/fastapi/middleware/”, line 20, in call
raise e
File “/usr/local/lib/python3.10/dist-packages/fastapi/middleware/”, line 17, in call
await, receive, send)
File “/usr/local/lib/python3.10/dist-packages/starlette/”, line 718, in call
await route.handle(scope, receive, send)
File “/usr/local/lib/python3.10/dist-packages/starlette/”, line 276, in handle
await, receive, send)
File “/usr/local/lib/python3.10/dist-packages/starlette/”, line 66, in app
response = await func(request)
File “/usr/local/lib/python3.10/dist-packages/fastapi/”, line 274, in app
raw_response = await run_endpoint_function(
File “/usr/local/lib/python3.10/dist-packages/fastapi/”, line 191, in run_endpoint_function
return await**values)
File “/usr/local/lib/python3.10/dist-packages/gradio/”, line 661, in queue_data
File “/usr/local/lib/python3.10/dist-packages/gradio/”, line 132, in attach_data
raise ValueError(“Event not found”, event_id)
ValueError: (‘Event not found’, ‘82efb9d9674c4ef7aad670b356a0e356’)

Any ideas on that?

1 Like