ChuanhuChatGPT
ChuanhuChatGPT copied to clipboard
[本地部署] 127.0.0.1可以访问,但是局域网ip无法访问
HTTP ERROR 503 终端没有什么提示 怎么办大佬们?应该是小问题,但是我是萌新不会
I meet the same error
将程序最后一句改成demo.launch(server_name="0.0.0.0", server_port=<你的端口号>)
我也遇到了这个问题,并且楼上的方法不 work。。。
把最后几行原代码: if authflag: demo.queue().launch(share=False, auth=(username, password), favicon_path="./assets/favicon.png") else: demo.queue().launch(share=False, favicon_path="./assets/favicon.png") 改为以下代码,就可以了。 if authflag: demo.queue().launch(server_name="0.0.0.0", server_port=7860, share=False, auth=(username, password), favicon_path="./assets/favicon.png") else: demo.queue().launch(server_name="0.0.0.0", server_port=7860, share=False, favicon_path="./assets/favicon.png")
修改该之后已解决
已改成
if dockerflag:
if authflag:
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
server_name="0.0.0.0", server_port=7860, auth=(username, password),
favicon_path="./assets/favicon.png"
)
else:
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860, share=False, favicon_path="./assets/favicon.png")
# if not running in Docker
else:
if authflag:
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860, share=False, auth=(username, password), favicon_path="./assets/favicon.png", inbrowser=True)
else:
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860, share=False, favicon_path="./assets/favicon.png", inbrowser=True) # 改为 share=True 可以创建公开分享链接
还是不行TT,在本机用localhost:7860或127.0.0.1:7860打开是可以的,在本机或内网任何设置用本机在内网的 ip 打开就不行了,后台也没有任何提示。从外网用路由器转发端口尝试连接也不行。
我的内网网段为192.168.5.,路由器为华硕,在路由器和本机无论挂不挂代理,都无法用 http://192.168.5.:7860打开。局域网内的 Mac 和 Debian 虚拟机分别都试过,都遇到了同样的问题,用外网端口转发或内网 ip 都无法打开,终端后台没任何提示。
Okay, the problem is finally solved on my Debian virtual machine (although I don't know how)... Here is my modified script:
# if running in Docker
if dockerflag:
if authflag:
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
server_name="0.0.0.0",
server_port=7860,
auth=(username, password),
favicon_path="./assets/favicon.png",
)
else:
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
server_name="0.0.0.0",
server_port=7860,
share=False,
favicon_path="./assets/favicon.png",
)
# if not running in Docker
else:
if authflag:
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
server_name="0.0.0.0",
share=False,
auth=(username, password),
favicon_path="./assets/favicon.png",
inbrowser=True,
)
else:
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(
server_name="0.0.0.0",
share=False, favicon_path="./assets/favicon.ico", inbrowser=True
) # 改为 share=True 可以创建公开分享链接
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860, share=False) # 可自定义端口
# demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=7860,auth=("在这里填写用户名", "在这里填写密码")) # 可设置用户名与密码
# demo.queue(concurrency_count=CONCURRENT_COUNT).launch(auth=("在这里填写用户名", "在这里填写密码")) # 适合Nginx反向代理