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

cannot connect to host #1

Closed
HuangZhen02 opened this issue May 15, 2023 · 2 comments
Closed

cannot connect to host #1

HuangZhen02 opened this issue May 15, 2023 · 2 comments

Comments

@HuangZhen02
Copy link

I have confirmed that I use the correct api key by successfully using the openAi API to generate sentences in Python.

However, when running the code:

asyncio.run(
process_api_requests_from_file(
requests_filepath=config.request_path,
save_filepath=config.response_path,
request_url = config.api_url,
api_key=config.api_key,
max_requests_per_minute=config.max_requests_per_minute,
max_tokens_per_minute=config.max_tokens_per_minute,
token_encoding_name=config.token_encoding_name,
max_attempts=config.max_attempts,
proxy=config.proxy,
)
)

Some errors just occur in the log file:
failed with Exception Cannot connect to host api.openai.com:443 ssl:default [Connect call failed ('199.96.58.105', 443)]

Is something wrong with my network or the url in the code? I would appreciate it if you can give me a hand to this issue!!

@rainym00d
Copy link
Owner

Thanks for your issue!

I clone the latest repo and try it in my PC. However, no error occured.

My parameter is as follows:

class MyArgs(Xp):
    model = ["gpt-3.5-turbo"]
    domain = ["Movie"]
    task = ["list"]
    no_instruction = False
    example_num = [1]
    begin_index = 5
    end_index = 10
    api_key = "YOUR_API_KEY"
    max_requests_per_minute = 2000
    max_tokens_per_minute = 80000
    max_attempts = 100
    proxy = "http://127.0.0.1:4780"

Could you share the parameters without your api-key to help me reproduce this error? I will appreciate it if you do.

By the way, I believe the most likely reason for this issue is a network problem. Maybe you should check your proxy.

@HuangZhen02
Copy link
Author

After setting my proxy again, it worked for me. Thanks for your help !! Best wishes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants