refactor: Modify default webserver port to 5670 (#1410)

This commit is contained in:
Fangyin Cheng
2024-04-12 11:47:24 +08:00
committed by GitHub
parent aea575e0b4
commit c3ae1915d2
26 changed files with 58 additions and 62 deletions

View File

@@ -26,7 +26,7 @@ class Config(metaclass=Singleton):
# Gradio language version: en, zh
self.LANGUAGE = os.getenv("LANGUAGE", "en")
self.WEB_SERVER_PORT = int(os.getenv("WEB_SERVER_PORT", 5000))
self.DBGPT_WEBSERVER_PORT = int(os.getenv("DBGPT_WEBSERVER_PORT", 5670))
self.debug_mode = False
self.skip_reprompt = False

View File

@@ -254,14 +254,10 @@ class RetrieveSummaryAssistantAgent(ConversableAgent):
reply_message.success = is_success
return reply_message
async def verify(
self,
message: AgentMessage,
sender: Agent,
reviewer: Optional[Agent] = None,
**kwargs,
async def correctness_check(
self, message: AgentMessage
) -> Tuple[bool, Optional[str]]:
"""Verify the correctness of the message."""
"""Verify the correctness of the results."""
action_report = message.action_report
task_result = ""
if action_report:

View File

@@ -140,9 +140,9 @@ 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
param.port = param.port or CFG.DBGPT_WEBSERVER_PORT
if not param.port:
param.port = 5000
param.port = 5670
print(param)

View File

@@ -6,7 +6,7 @@ import click
from dbgpt.configs.model_config import DATASETS_DIR
_DEFAULT_API_ADDRESS: str = "http://127.0.0.1:5000"
_DEFAULT_API_ADDRESS: str = "http://127.0.0.1:5670"
API_ADDRESS: str = _DEFAULT_API_ADDRESS
logger = logging.getLogger("dbgpt_cli")

View File

@@ -61,7 +61,7 @@ class Client:
Args:
api_base: Optional[str], a full URL for the DB-GPT API.
Defaults to the `http://localhost:5000/api/v2`.
Defaults to the `http://localhost:5670/api/v2`.
api_key: Optional[str], The dbgpt api key to use for authentication.
Defaults to None.
timeout: Optional[httpx._types.TimeoutTypes]: The timeout to use.
@@ -77,14 +77,14 @@ class Client:
from dbgpt.client import Client
DBGPT_API_BASE = "http://localhost:5000/api/v2"
DBGPT_API_BASE = "http://localhost:5670/api/v2"
DBGPT_API_KEY = "dbgpt"
client = Client(api_base=DBGPT_API_BASE, api_key=DBGPT_API_KEY)
client.chat(model="chatgpt_proxyllm", messages="Hello?")
"""
if not api_base:
api_base = os.getenv(
"DBGPT_API_BASE", f"http://localhost:5000/{CLIENT_API_PATH}/{version}"
"DBGPT_API_BASE", f"http://localhost:5670/{CLIENT_API_PATH}/{version}"
)
if not api_key:
api_key = os.getenv("DBGPT_API_KEY")
@@ -146,7 +146,7 @@ class Client:
from dbgpt.client import Client
DBGPT_API_BASE = "http://localhost:5000/api/v2"
DBGPT_API_BASE = "http://localhost:5670/api/v2"
DBGPT_API_KEY = "dbgpt"
client = Client(api_base=DBGPT_API_BASE, api_key=DBGPT_API_KEY)
res = await client.chat(model="chatgpt_proxyllm", messages="Hello?")
@@ -222,7 +222,7 @@ class Client:
from dbgpt.client import Client
DBGPT_API_BASE = "http://localhost:5000/api/v2"
DBGPT_API_BASE = "http://localhost:5670/api/v2"
DBGPT_API_KEY = "dbgpt"
client = Client(api_base=DBGPT_API_BASE, api_key=DBGPT_API_KEY)
res = await client.chat_stream(model="chatgpt_proxyllm", messages="Hello?")

View File

@@ -1022,7 +1022,7 @@ def initialize_worker_manager_in_client(
model_path: str = None,
run_locally: bool = True,
controller_addr: str = None,
local_port: int = 5000,
local_port: int = 5670,
embedding_model_name: str = None,
embedding_model_path: str = None,
start_listener: Callable[["WorkerManager"], None] = None,

View File

@@ -23,7 +23,7 @@ model_path = LLM_MODEL_CONFIG[model_name]
# or vllm
model_type = "huggingface"
controller_addr = "http://127.0.0.1:5000"
controller_addr = "http://127.0.0.1:5670"
result_csv_file = None

View File

@@ -66,7 +66,7 @@ def _run_current_with_gunicorn(app: str, config_path: str, kwargs: Dict):
env_to_app.update(os.environ)
app_env = EnvArgumentParser._kwargs_to_env_key_value(kwargs)
env_to_app.update(app_env)
cmd = f"uvicorn {app} --host 0.0.0.0 --port 5000"
cmd = f"uvicorn {app} --host 0.0.0.0 --port 5670"
if "windows" in platform.system().lower():
raise Exception("Not support on windows")
else: # macOS, Linux, and other Unix-like systems
@@ -137,8 +137,8 @@ def _get_ports_by_cmdline_part(service_keys: List[str]) -> List[int]:
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
pass
# Sort ports with preference for 8000 and 5000
ports.sort(key=lambda x: (x != 8000, x != 5000, x))
# Sort ports with preference for 8000 and 5670
ports.sort(key=lambda x: (x != 8000, x != 5670, x))
return ports