互联网
使用public url可以使得任何设备访问当前设备的chat with rtx
1. 找到配置文件
C:\Users\{Your user dir}\AppData\Local\NVIDIA\ChatWithRTX\RAG\trt-llm-rag-windows-main\ui\user_interface.py
2. 更新user_interface.py中的启动代码
interface. Launch(
favicon_path=os.path.join(os.path.dirname(__file__), 'assets/nvidia_logo.png'),
show_api=False,
server_port=port
)
在上方代码中增加share=True,变成下方的形式
interface.launch(
favicon_path=os.path.join(os.path.dirname(__file__), 'assets/nvidia_logo.png'),
show_api=False,
share=True,
server_port=port
)
3. 保存并执行
4. 生成public url并访问
启动后在命令行界面会产生下面三行提示信息
Open http://127.0.0.1:16852?cookie=07371889-f094-43ee-9f7b-c8755b77fe96&__theme=dark in browser to start Chat with RTX
Running on local URL: http://127.0.0.1:16852
Public URL: https://97869bc6593d2d7e75.gradio.live
在使用public url访问chat with rtx时,需要注意带上cookie信息才可以,如下方的形式才会正确访问,否则会报invalid session的错误
https://97869bc6593d2d7e75.gradio.live?cookie=07371889-f094-43ee-9f7b-c8755b77fe96&__theme=dark
局域网
1. 找到配置文件
C:\Users\{Your user dir}\AppData\Local\NVIDIA\ChatWithRTX\RAG\trt-llm-rag-windows-main\ui\user_interface.py
2. 更新user_interface.py中的启动代码
interface. Launch(
favicon_path=os.path.join(os.path.dirname(__file__), 'assets/nvidia_logo.png'),
show_api=False,
server_port=port
)
在上方代码中增加server_name="0.0.0.0",变成下方的形式
interface.launch(
favicon_path=os.path.join(os.path.dirname(__file__), 'assets/nvidia_logo.png'),
show_api=False,
server_name="0.0.0.0",
server_port=port
)
3. 保存并执行
4. 生成public url并访问
Open http://0.0.0.0:16852?cookie=07371889-f094-43ee-9f7b-c8755b77fe96&__theme=dark in browser to start Chat with RTX
Running on local URL: http://0.0.0.0:16852
To create a public link, set "share=True" in "launch()".
启动后在命令行界面会产生下面三行提示信息
查找当前机器的IP,在cmd中输入ipconfig,记住IPV4对应的信息,比如192.168.5.78
局域网中其他机器访问chat with rtx,记住仍然要带上cookie
https://192.168.5.78:16852?cookie=07371889-f094-43ee-9f7b-c8755b77fe96&__theme=dark
参考来源:Chat with RTX Easy Guide: Running on LAN & Making It Pu (cgvizstudio.com)
侵删