-
Notifications
You must be signed in to change notification settings - Fork 77
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
我在Mac上用shadow racket代理可以访问chatgpt,我应该怎么设置docker才能让docker走shadowracket代理访问chatgpt? #51
Comments
以上是我所有的设置,但是仍显示错误,不知道问题出在哪 |
按照您的意见修改完后仍然报错 |
我尝试ping |
ping 172.17.0.1:1000 |
nc localhost 1000 -v
# 显示 "Connection to ... succeeded!" 则成功 或 telnet localhost 1000
# 显示 "Connected to ..." 则成功
nc host.docker.internal 1000 -v 或 telnet host.docker.internal 1000 看看能否成功连接。 (万一 nc 和 telnet 都没有的话随便装一个吧) |
telnet localhost 1000 显示失败了 |
那说明你的代理软件没有配置好吧 |
在哪里设置呢 |
再改回 127.0.0.1 试试?😅 |
我吧端口重置 为原来的,就"Connection to ... succeeded!" |
那你把 |
environment: 这样设置还是报错诶 |
During handling of the above exception, another exception occurred: |
你重启服务组了没?重新 |
重组之后代理显示正常,但还是报错 |
你在容器里试试能 telnet 连到代理吗 |
(base) zjk-macminim1@Zjk-MacdeMac-mini muvtuber % telnet host.docker.internal 1082 |
(base) zjk-macminim1@Zjk-MacdeMac-mini muvtuber % nc host.docker.internal 1082 -v |
啊?这不是容器内叭 🥺 你试试这种炼金去的: docker compose exec chatgpt_chatbot sh |
(base) zjk-macminim1@Zjk-MacdeMac-mini muvtuber % docker compose exec chatgpt_chatbot sh telnet host.docker.internal 1082telnet: could not resolve host.docker.internal/1082: Name or service not known 显示错误 |
这个 host.docker.internal 按照 docker desktop 的文档应该是可用的。 所以还是代理设置的问题吧,我还是觉得代理要监听 0.0.0.0 应该才能访问到,你再试试改一下?(改完要重启代理软件哦) |
(base) zjk-macminim1@Zjk-MacdeMac-mini muvtuber % docker compose exec chatgpt_chatbot sh telnet host.docker.internal 1082telnet: could not resolve host.docker.internal/1082: Name or service not known 还是显示错误诶 |
你在宿主机开一个其他服务,在容器内能访问到嘛 比如宿主机uh:
然后在里:
|
您使用的代理软件是什么,或许我 change 一下软件就行了? |
Docker desktop 文档不是说这个地址是可用的嘛 😭(我自己是用的 colima 所以我不清楚 docker desktop 的具体情况 emmm,开 python 服务之后 mac 弹的那个允许传入网络连接对话框允许了没 |
允许了的 |
太难了吧,宝子 |
这个网络就是很烦,每个人的情况都不一样。解决这个办法挺多的,主要不知道你用啥方案比较方便 你在容器里和 docker 的 vm 里分别 |
请问应该怎么查呢 |
我ifconfig (base) zjk-macminim1@Zjk-MacdeMac-mini ~ % ifconfig |
(base) zjk-macminim1@Zjk-MacdeMac-mini ~ % host host.docker.internal |
我自己常用的一种手段是在容器内开一个陷阱服务,然后从宿主机去访问这个服务,便记录下了容器眼里宿主机的 ip。大概就这样吧。 除了找出 ip 去连,这个问题其他解决方案也很多:
还有,想起来以前有个老哥说他是这么解决的:
|
太好了🥹 但是为啥,这个具体是怎么个配法我还是没理解(我没用docker desktop不了解)。
通过docker desktop的settings-resources-proxies写了宿主机的ip(我写的就是宿主机以太网下的本地ipv4地址),
这个是怎么配的呢?我想了解一下在文档里详细写一写。
或者如果你能帮忙 pr 改一改 README 就更棒了🥰
|
哦哦,是 Settings -> Resources -> Proxies 的意思啊。这下看懂了。我之前以为是在某个神秘的地方去写某个 |
这样设置对小白很友好🥰 |
2023-06-05 22:01:07
2023-06-05 22:01:07 During handling of the above exception, another exception occurred:
2023-06-05 22:01:07
2023-06-05 22:01:07 Traceback (most recent call last):
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
2023-06-05 22:01:07 resp = conn.urlopen(
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
2023-06-05 22:01:07 retries = retries.increment(
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
2023-06-05 22:01:07 raise MaxRetryError(_pool, url, error or ResponseError(cause))
2023-06-05 22:01:07 urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xffffa80f2230>: Failed to establish a new connection: [Errno -2] Name or service not known')))
2023-06-05 22:01:07
2023-06-05 22:01:07 During handling of the above exception, another exception occurred:
2023-06-05 22:01:07
2023-06-05 22:01:07 Traceback (most recent call last):
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/grpc/_server.py", line 444, in _call_behavior
2023-06-05 22:01:07 response_or_iterator = behavior(argument, context)
2023-06-05 22:01:07 File "/app/chatgpt/grpcapi.py", line 37, in NewSession
2023-06-05 22:01:07 session_id = self.multiChatGPT.new_session(config)
2023-06-05 22:01:07 File "/app/chatgpt/chatbot.py", line 289, in new_session
2023-06-05 22:01:07 self.chatgpts[session_id] = ChatGPTProxy(
2023-06-05 22:01:07 File "/app/chatgpt/chatbot.py", line 189, in init
2023-06-05 22:01:07 self.renew()
2023-06-05 22:01:07 File "/app/chatgpt/chatbot.py", line 193, in renew
2023-06-05 22:01:07 self.chatgpt = self._new_chatgpt(self.config)
2023-06-05 22:01:07 File "/app/chatgpt/chatbot.py", line 207, in _new_chatgpt
2023-06-05 22:01:07 new_chatgpt = ChatGPTv3(config={
2023-06-05 22:01:07 File "/app/chatgpt/chatbot.py", line 94, in init
2023-06-05 22:01:07 self.chatbot = ChatbotV3(
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/revChatGPT/V3.py", line 68, in init
2023-06-05 22:01:07 if self.get_token_count("default") > self.max_tokens:
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/revChatGPT/V3.py", line 116, in get_token_count
2023-06-05 22:01:07 encoding = tiktoken.encoding_for_model(self.engine)
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/tiktoken/model.py", line 75, in encoding_for_model
2023-06-05 22:01:07 return get_encoding(encoding_name)
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/tiktoken/registry.py", line 63, in get_encoding
2023-06-05 22:01:07 enc = Encoding(**constructor())
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/tiktoken_ext/openai_public.py", line 64, in cl100k_base
2023-06-05 22:01:07 mergeable_ranks = load_tiktoken_bpe(
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/tiktoken/load.py", line 114, in load_tiktoken_bpe
2023-06-05 22:01:07 contents = read_file_cached(tiktoken_bpe_file)
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/tiktoken/load.py", line 46, in read_file_cached
2023-06-05 22:01:07 contents = read_file(blobpath)
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/tiktoken/load.py", line 24, in read_file
2023-06-05 22:01:07 return requests.get(blobpath).content
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get
2023-06-05 22:01:07 return request("get", url, params=params, **kwargs)
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
2023-06-05 22:01:07 return session.request(method=method, url=url, **kwargs)
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
2023-06-05 22:01:07 resp = self.send(prep, **send_kwargs)
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
2023-06-05 22:01:07 r = adapter.send(request, **kwargs)
2023-06-05 22:01:07 File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 559, in send
2023-06-05 22:01:07 raise ProxyError(e, request=request)
2023-06-05 22:01:07 requests.exceptions.ProxyError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xffffa80f2230>: Failed to establish a new connection: [Errno -2] Name or service not known')))
The text was updated successfully, but these errors were encountered: