diff --git a/dbgpt/_private/config.py b/dbgpt/_private/config.py index 893388b34..60fd90b86 100644 --- a/dbgpt/_private/config.py +++ b/dbgpt/_private/config.py @@ -25,7 +25,7 @@ def __init__(self) -> None: # Gradio language version: en, zh self.LANGUAGE = os.getenv("LANGUAGE", "en") - self.WEB_SERVER_PORT = int(os.getenv("WEB_SERVER_PORT", 7860)) + self.WEB_SERVER_PORT = int(os.getenv("WEB_SERVER_PORT", 5000)) self.debug_mode = False self.skip_reprompt = False diff --git a/dbgpt/app/base.py b/dbgpt/app/base.py index 6aaa491d2..bbdff3198 100644 --- a/dbgpt/app/base.py +++ b/dbgpt/app/base.py @@ -218,7 +218,7 @@ class WebServerParameters(BaseParameters): default="0.0.0.0", metadata={"help": "Webserver deploy host"} ) port: Optional[int] = field( - default=5000, metadata={"help": "Webserver deploy port"} + default=None, metadata={"help": "Webserver deploy port"} ) daemon: Optional[bool] = field( default=False, metadata={"help": "Run Webserver in background"} diff --git a/dbgpt/app/dbgpt_server.py b/dbgpt/app/dbgpt_server.py index c35287fa6..124dee4a9 100644 --- a/dbgpt/app/dbgpt_server.py +++ b/dbgpt/app/dbgpt_server.py @@ -140,6 +140,10 @@ def initialize_app(param: WebServerParameters = None, args: List[str] = None): model_name = param.model_name or CFG.LLM_MODEL param.model_name = model_name + param.port = param.port or CFG.WEB_SERVER_PORT + if not param.port: + param.port = 5000 + print(param) embedding_model_name = CFG.EMBEDDING_MODEL