Skip to content

Commit

Permalink
fix: Fix the issue of invalid port settings (#1351)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsRuner authored Mar 29, 2024
1 parent a272d1b commit 4238a67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dbgpt/_private/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbgpt/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
4 changes: 4 additions & 0 deletions dbgpt/app/dbgpt_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4238a67

Please sign in to comment.