chenfei-wu / TaskMatrix

Other
34.54k stars 3.32k forks source link

开代理就没办法运行,不开代理,运行起来没办法连接openai服务器 (cannot run with the VPN on, cannot connect to `api.openai.com` with the VPN off) #323

Closed MaJining92 closed 1 year ago

MaJining92 commented 1 year ago

中国,代理用的是v2ray N,shadowsocks和vmess都试过了,都不行。 located in China, use the v2rayN as the proxy software, tried both shadowsocks and vmess nodes, none of them worked

具体问题描述:

  1. win10,已经配置好了各种环境,安装好了requirements中的包
    0. requirements.txt installed

  2. 给powershell配置了proxy 1. set the proxy for the powershell

  3. 如果开启代理,那么运行python visual_chatgpt.py --load "ImageCaptioning_cuda:0,Text2Image_cuda:0"时,会报如下错误: 2. with the vpn on, if I runpython visual_chatgpt.py --load "ImageCaptioning_cuda:0,Text2Image_cuda:0", it will give the error below:

SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url:
/Salesforce/blip-image-captioning-base/resolve/main/preprocessor_config.json (Caused by SSLError(SSLEOFError(8, 'EOF occurred in
violation of protocol (_ssl.c:1131)')))

所以,只能不开代理先把模型load起来,以及网页服务器跑起来; [thus, I have to turn off the vpn, and let the model and the web server run first]

  1. 如果不开启代理,进入0.0.0.0:1015后,输入prompt后,无法连接OpenAI服务器,报如下错误: 3. but if I turn off the VPN, after I tried prompting in the local web server, it tells me thatapi.openai.comcannot be reached
    Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001CDEA35C4C0>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。')).
    Retrying langchain.llms.openai.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/completions (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001CDEA35CE20>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。')).

请问有人遇到过类似问题吗?如何解决的呢? is there anyone could provide a solution?

MaJining92 commented 1 year ago

参考这个回答: https://github.com/openai/openai-python/issues/56#issuecomment-1453294894