Skip to content
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

执行python startup.py -a 失败 #3350

Closed
jimmywangzhiping opened this issue Mar 15, 2024 · 1 comment
Closed

执行python startup.py -a 失败 #3350

jimmywangzhiping opened this issue Mar 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jimmywangzhiping
Copy link

D:\Users\dddd\AppData\Local\anaconda3\Lib\site-packages\langchain_core_api\deprecation.py:117: LangChainDeprecationWarning: 模型启动功能将于 Langchain-Chatchat 0.3.x重写,支持更多模式和加速启动,0.2.x中
相关功能将废弃
warn_deprecated(
ERROR: [Errno 10048] error while attempting to bind on address ('127.0.0.1', 20001): 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。
端口怎么出现重复

@jimmywangzhiping jimmywangzhiping added the bug Something isn't working label Mar 15, 2024
Copy link

dosubot bot commented Mar 15, 2024

嘿,@jimmywangzhiping!又见面了,希望你今天心情不错~

您遇到的 "Port is already in use" 错误可能是由于某个服务(控制器,模型工作器,OpenAI API,API服务器,或者Web UI)试图绑定到一个已经被其他进程占用的端口。这可能是由于以下原因:

  1. 同一服务的另一个实例已经在运行。
  2. 另一个应用程序正在使用该端口。
  3. 之前的服务实例没有正确关闭。

在您提供的代码中,每个服务(控制器,模型工作器,OpenAI API,API服务器,和Web UI)都是通过调用 uvicorn.run(app, host=host, port=port, log_level=log_level.lower()) 或者类似的命令来启动的。hostport 变量在代码的各个部分中定义,表示每个服务试图绑定的网络地址和端口号。

要解决这个问题,您可以:

  • 在启动应用程序之前,确保没有其他服务实例在运行。
  • 检查其他应用程序是否正在使用配置中指定的端口(FSCHAT_CONTROLLER["port"]FSCHAT_OPENAI_API["port"]API_SERVER["port"],和 WEBUI_SERVER["port"])。您可以使用像 netstat 这样的工具在Windows上,或者 lsof 在Unix-based系统上检查端口使用情况。
  • 确保配置中指定的端口没有被操作系统或网络策略保留或限制。
  • 如果当前的端口不可避免地被使用,更改配置以使用不同的端口。

错误消息没有指定哪个端口有冲突,所以您可能需要检查每个服务的配置,并确保端口在启动应用程序之前是可用的。

在Langchain-Chatchat配置中,每个服务(控制器,模型工作器,OpenAI API,API服务器,和Web UI)的默认端口号如下:

  • 控制器:20001
  • 模型工作器:20002
  • OpenAI API:20000
  • API服务器:7861
  • Web UI:8501

在Langchain-Chatchat存储库中,python startup.py -a 命令的功能是启动与应用程序相关的多个服务。具体来说,它设置标志以启用所有组件的运行,包括OpenAI API,模型工作器,API服务器,API工作器,和Web UI。这是从脚本中的条件检查和参数设置中推断出来的,其中 -a 可能代表 "all" 或类似的概念,以启动应用程序的所有组件。

参考资料:

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants