Error with gradio application with openai
Hello everyone, yesterday I created a simple app in hugging face platform. The app is just a gradio chat integrated with openai.The app was working fine yesterday however today everytime I try to ask something to the chat it gives the following error:The above exception was the direct cause of the following exception:Traceback (most recent call last):File “/home/user/.local/lib/python3.10/site-packages/gradio/routes.py”, line 437, in run_predictoutput = await app.get_blocks().process_api(File “/home/user/.local/lib/python3.10/site-packages/gradio/blocks.py”, line 1352, in process_apiresult = await self.call_function(File “/home/user/.local/lib/python3.10/site-packages/gradio/blocks.py”, line 1077, in call_functionprediction = await anyio.to_thread.run_sync(File “/home/user/.local/lib/python3.10/site-packages/anyio/to_thread.py”, line 33, in run_syncreturn await get_asynclib().run_sync_in_worker_thread(File “/home/user/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py”, line 877, in run_sync_in_worker_threadreturn await futureFile “/home/user/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py”, line 807, in runresult = context.run(func, *args)File “/home/user/app/app.py”, line 13, in chatbotchat = openai.ChatCompletion.create(File “/home/user/.local/lib/python3.10/site-packages/openai/api_resources/chat_completion.py”, line 25, in createreturn super().create(*args, **kwargs)File “/home/user/.local/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py”, line 153, in createresponse, _, api_key = requestor.request(File “/home/user/.local/lib/python3.10/site-packages/openai/api_requestor.py”, line 288, in requestresult = self.request_raw(File “/home/user/.local/lib/python3.10/site-packages/openai/api_requestor.py”, line 609, in request_rawraise error.APIConnectionError(openai.error.APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host=‘api.openai.com’, port=443): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7f3e8525d9c0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’))Not sure why today is having that errorAny idea?I also have the same application in a virtual machine and it works fine there, the only place it does not work is in huggingfaceThanks in advance!
2023-06-20T08:44:54Z
probably related toBuild error without logand others like it.
2023-06-20T08:48:08Z
Hey thanks for the reply. I restarted the space and the app was built without any errors. The errors appeared when I interacted with the chatbot
2023-06-20T08:50:01Z
Oh yay!  My spaces are now building too.[party!]
2023-06-20T08:57:56Z
Now it works, looks like it was something related to huggingface environment