gpt4free
gpt4free copied to clipboard
OpenAI style Api on port 1337 doesn't work
Bug description I deployed this project with docker on a Hong Kong server. When I updated the image to 0.3.10. The api on port 1337 cannot work porperly. Though ai can answer on the site on port 8080. (My English isn't very good😢)
Environment
- docker image version: 0.3.10
- location: Hong Kong
Additional context
ERROR:root:RetryProvider failed:
Bing: ValueError: Can't patch loop of type <class 'uvloop.Loop'>
Liaobots: ValueError: Can't patch loop of type <class 'uvloop.Loop'>
Traceback (most recent call last):
File "/app/g4f/api/__init__.py", line 165, in streaming
async for chunk in response:
File "/app/g4f/client/async_client.py", line 63, in iter_append_model_and_provider
async for chunk in response:
File "/app/g4f/client/async_client.py", line 37, in iter_response
async for chunk in response:
File "/app/g4f/client/helper.py", line 46, in cast_iter_async
for chunk in iter:
File "/app/g4f/providers/retry_provider.py", line 95, in create_completion
raise_exceptions(exceptions)
File "/app/g4f/providers/retry_provider.py", line 231, in raise_exceptions
raise RetryProviderError("RetryProvider failed:\n" + "\n".join([
g4f.errors.RetryProviderError: RetryProvider failed:
Bing: ValueError: Can't patch loop of type <class 'uvloop.Loop'>
Liaobots: ValueError: Can't patch loop of type <class 'uvloop.Loop'>
INFO: 154.64.252.2:44614 - "POST /v1/chat/completions HTTP/1.1" 200 OK
ERROR:root:RetryProvider failed:
Liaobots: ValueError: Can't patch loop of type <class 'uvloop.Loop'>
Bing: ValueError: Can't patch loop of type <class 'uvloop.Loop'>
Traceback (most recent call last):
File "/app/g4f/api/__init__.py", line 165, in streaming
async for chunk in response:
File "/app/g4f/client/async_client.py", line 63, in iter_append_model_and_provider
async for chunk in response:
File "/app/g4f/client/async_client.py", line 37, in iter_response
async for chunk in response:
File "/app/g4f/client/helper.py", line 46, in cast_iter_async
for chunk in iter:
File "/app/g4f/providers/retry_provider.py", line 95, in create_completion
raise_exceptions(exceptions)
File "/app/g4f/providers/retry_provider.py", line 231, in raise_exceptions
raise RetryProviderError("RetryProvider failed:\n" + "\n".join([
g4f.errors.RetryProviderError: RetryProvider failed:
Liaobots: ValueError: Can't patch loop of type <class 'uvloop.Loop'>
Bing: ValueError: Can't patch loop of type <class 'uvloop.Loop'>
This is independent of the release version. Somehow the repositories have been updated and any release will contain this error. You can “fix” this by replacing the site-packages directory taken from the earlier venv in gpt4free/.venv/lib/python3.9/. It helped me. But I didn’t understand exactly which software was updated and which one needed to be rolled back. If you figure it out, please indicate a specific lib. Most likely, you need to edit the requirements.txt file indicating the version of this lib.
I'm also facing same problem. v0.3.0.8 is working fine.
i have the same problem
I have the same problem too!
I have the same problem too!
Me too ,Have u solved this problem?
loop='asyncio'
I fixed the uvloop issue.