Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI style Api on port 1337 doesn't work #1928

Closed
Wu-jiyan opened this issue May 7, 2024 · 8 comments
Closed

OpenAI style Api on port 1337 doesn't work #1928

Wu-jiyan opened this issue May 7, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@Wu-jiyan
Copy link

Wu-jiyan commented May 7, 2024

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'>
@Wu-jiyan Wu-jiyan added the bug Something isn't working label May 7, 2024
@al-1-fenix
Copy link

al-1-fenix commented May 9, 2024

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.

@Mahesh0253
Copy link

I'm also facing same problem. v0.3.0.8 is working fine.

@sharemen
Copy link

i have the same problem

@asiryan
Copy link

asiryan commented May 12, 2024

I have the same problem too!

1 similar comment
@1xiongyuwen1
Copy link

I have the same problem too!

@cloudygtosis
Copy link

Me too ,Have u solved this problem?

@AHiXilTOr
Copy link

loop='asyncio'

@hlohaus
Copy link
Collaborator

hlohaus commented May 19, 2024

I fixed the uvloop issue.

@hlohaus hlohaus closed this as completed May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants