xtekky / gpt4free

The official gpt4free repository | various collection of powerful language models
https://g4f.ai
GNU General Public License v3.0
61.09k stars 13.31k forks source link

Error communicating with OpenAI: RetryProvider failed: #1409

Closed AngelFireLA closed 9 months ago

AngelFireLA commented 10 months ago

Bug description I tried generating text like normal using the g4f python library but it just ouputs this : Error communicating with OpenAI: RetryProvider failed: Chatgpt4Online: RuntimeError: Event loop is closed GptGo: RuntimeError: Event loop is closed ChatAnywhere: RuntimeError: Event loop is closed GptForLove: RuntimeError: Event loop is closed ChatBase: RuntimeError: Event loop is closed You: RuntimeError: Event loop is closed Error communicating with OpenAI: RetryProvider failed: Chatgpt4Online: RuntimeError: Event loop is closed ChatBase: RuntimeError: Event loop is closed GptGo: RuntimeError: Event loop is closed GptForLove: RuntimeError: Event loop is closed You: RuntimeError: Event loop is closed ChatAnywhere: RuntimeError: Event loop is closed Error communicating with OpenAI: RetryProvider failed: ChatAnywhere: RuntimeError: Event loop is closed Chatgpt4Online: RuntimeError: Event loop is closed ChatBase: RuntimeError: Event loop is closed You: RuntimeError: Event loop is closed GptForLove: RuntimeError: Event loop is closed GptGo: RuntimeError: Event loop is closed Error communicating with OpenAI: RetryProvider failed: GptForLove: RuntimeError: Event loop is closed Chatgpt4Online: RuntimeError: Event loop is closed You: RuntimeError: Event loop is closed ChatBase: RuntimeError: Event loop is closed GptGo: RuntimeError: Event loop is closed ChatAnywhere: RuntimeError: Event loop is closed Error File "/content/ShortGPT/gui/ui_tab_short_automation.py", line 103, in create_short for step_num, step_info in shortEngine.makeContent(): File "/content/ShortGPT/shortGPT/engine/abstract_content_engine.py", line 74, in makeContent self.stepDict[currentStep]() File "/content/ShortGPT/shortGPT/engine/content_short_engine.py", line 81, in _generateImageSearchTerms self._db_timed_image_searches = gpt_editing.getImageQueryPairs( File "/content/ShortGPT/shortGPT/gpt/gpt_editing.py", line 6, in getImageQueryPairs res = gpt_utils.gpt3Turbo_completion(chat_prompt=prompt) File "/content/ShortGPT/shortGPT/gpt/gpt_utils.py", line 101, in gpt3Turbo_completion raise Exception("GPT3 error: %s" % oops)

ex. using the https://github.com/RayVentura/ShortGPT collab link, I modified the gpt_utils file to use g4f instead of normal openai, and didn't change anything else

Environment

Additional context Add any other context about the problem here.

AngelFireLA commented 10 months ago

more detailed error : ERROR : Retryprovidererror : RetryProvider failed: GptForLove: RuntimeError: Event loop is closed Chatgpt4Online: RuntimeError: Event loop is closed You: RuntimeError: Event loop is closed ChatBase: RuntimeError: Event loop is closed ChatAnywhere: RuntimeError: Event loop is closed GptGo: RuntimeError: Event loop is closed Traceback Info : File "/content/ShortGPT/gui/ui_tab_short_automation.py", line 103, in create_short for step_num, step_info in shortEngine.makeContent(): File "/content/ShortGPT/shortGPT/engine/abstract_content_engine.py", line 74, in makeContent self.stepDict[currentStep]() File "/content/ShortGPT/shortGPT/engine/content_short_engine.py", line 81, in _generateImageSearchTerms self._db_timed_image_searches = gpt_editing.getImageQueryPairs( File "/content/ShortGPT/shortGPT/gpt/gpt_editing.py", line 6, in getImageQueryPairs res = gpt_utils.gpt3Turbo_completion(chat_prompt=prompt) File "/content/ShortGPT/shortGPT/gpt/gpt_utils.py", line 84, in gpt3Turbo_completion response = openai.ChatCompletion.create( File "/usr/local/lib/python3.10/dist-packages/g4f/init.py", line 79, in create return result if stream else ''.join(result) File "/usr/local/lib/python3.10/dist-packages/g4f/Provider/retry_provider.py", line 60, in create_completion self.raise_exceptions() File "/usr/local/lib/python3.10/dist-packages/g4f/Provider/retry_provider.py", line 88, in raise_exceptions raise RetryProviderError("RetryProvider failed:\n" + "\n".join([

hlohaus commented 10 months ago

I added a check for: Event loop is closed https://github.com/xtekky/gpt4free/pull/1414

github-actions[bot] commented 10 months ago

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] commented 9 months ago

Closing due to inactivity.