I’m using gpt_academic via a local socks5h proxy, but which will trigger the following error when I try to input some text in gpt_academic’s gradio based frontend:
werner@X10DAi:~$ gpt_academic
[ENV_VAR] 尝试加载proxies,默认值:None --> 修正值:{ "http": "socks5h://localhost:18890", "https": "socks5h://localhost:18890" }
[ENV_VAR] 成功读取环境变量proxies
[ENV_VAR] 尝试加载USE_PROXY,默认值:False --> 修正值:True
[ENV_VAR] 成功读取环境变量USE_PROXY
[PROXY] 网络代理状态:已配置。配置信息如下: {'http': 'socks5h://localhost:18890', 'https': 'socks5h://localhost:18890'}
[ENV_VAR] 尝试加载API_URL_REDIRECT,默认值:{} --> 修正值:{"https://api.openai.com/v1/chat/completions": "https://api.chatgpt-3.vip/v1/chat/completions"}
[ENV_VAR] 成功读取环境变量API_URL_REDIRECT
[ENV_VAR] 尝试加载LLM_MODEL,默认值:gpt-3.5-turbo --> 修正值:gpt-4
[ENV_VAR] 成功读取环境变量LLM_MODEL
所有问询记录将自动保存在本地目录./gpt_log/chat_secrets.log, 请注意自我隐私保护哦!
代理配置 socks5h://localhost:18890, 代理所在地:United States - Cloudflare, Inc.
[ENV_VAR] 尝试加载API_KEY,默认值:此处填API密钥 --> 修正值:sk-xxx
[ENV_VAR] 成功读取环境变量API_KEY
[API_KEY] 本项目现已支持OpenAI和Azure的api-key。也支持同时填写多个api-key,如API_KEY="openai-key1,openai-key2,azure-key3"
[API_KEY] 您既可以在config.py中修改api-key(s),也可以在问题输入区输入临时的api-key(s),然后回车键提交后即可生效。
[API_KEY] 您的 API_KEY 是: sk-nto0MuxwhqgC*** API_KEY 导入成功
如果浏览器没有自动打开,请复制并转到以下URL:
(亮色主题): http://localhost:33263
(暗色主题): http://localhost:33263/?__theme=dark
正在执行一些模块的预热...
正在加载tokenizer,如果是第一次运行,可能需要一点时间下载参数
加载tokenizer完毕
正在加载tokenizer,如果是第一次运行,可能需要一点时间下载参数
加载tokenizer完毕
Traceback (most recent call last):
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/urllib3/connectionpool.py", line 536, in _make_request
response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/urllib3/connection.py", line 461, in getresponse
httplib_response = super().getresponse()
^^^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/3.11.1/lib/python3.11/http/client.py", line 1374, in getresponse
response.begin()
File "/home/werner/.pyenv/versions/3.11.1/lib/python3.11/http/client.py", line 318, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/3.11.1/lib/python3.11/http/client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/urllib3/connectionpool.py", line 844, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/urllib3/util/retry.py", line 470, in increment
raise reraise(type(error), error, _stacktrace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/urllib3/util/util.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/urllib3/connectionpool.py", line 536, in _make_request
response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/urllib3/connection.py", line 461, in getresponse
httplib_response = super().getresponse()
^^^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/3.11.1/lib/python3.11/http/client.py", line 1374, in getresponse
response.begin()
File "/home/werner/.pyenv/versions/3.11.1/lib/python3.11/http/client.py", line 318, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/3.11.1/lib/python3.11/http/client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/werner/Public/repo/github.com/binary-husky/gpt_academic.git/main.py", line 305, in <module>
main()
File "/home/werner/Public/repo/github.com/binary-husky/gpt_academic.git/main.py", line 287, in main
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/gradio/blocks.py", line 1775, in launch
requests.get(f"{self.local_url}startup-events", verify=ssl_verify)
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/werner/.pyenv/versions/gpt_academic/lib/python3.11/site-packages/requests/adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Any hints for this problem will be helpful.
Regards,
Zhao