From c265587b3b69156f91c4fbc5490affd0ec5666d6 Mon Sep 17 00:00:00 2001 From: mountain Date: Thu, 8 Aug 2024 17:57:20 +0800 Subject: [PATCH] only website address to be refered entity url --- webserver/configs/settings.py | 2 +- webserver/main.py | 2 +- webserver/utils/refer.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/webserver/configs/settings.py b/webserver/configs/settings.py index e7edca1eca..011c16a9e1 100644 --- a/webserver/configs/settings.py +++ b/webserver/configs/settings.py @@ -10,8 +10,8 @@ class Settings(BaseSettings): - server_host: str = "http://localhost" server_port: int = 20213 + website_address: str = f"http://127.0.0.1:{server_port}" data: str = ( "./output" ) diff --git a/webserver/main.py b/webserver/main.py index ebd43a0740..78526af583 100644 --- a/webserver/main.py +++ b/webserver/main.py @@ -332,4 +332,4 @@ def get_latest_model(model: str): if __name__ == "__main__": import uvicorn - uvicorn.run(app, host="localhost", port=settings.server_port) + uvicorn.run(app, port=settings.server_port) diff --git a/webserver/utils/refer.py b/webserver/utils/refer.py index 31b09467ee..5f066570cb 100644 --- a/webserver/utils/refer.py +++ b/webserver/utils/refer.py @@ -20,7 +20,7 @@ def get_reference(text: str) -> dict: def generate_ref_links(data: Dict[str, Set[int]], index_id: str) -> str: - base_url = f"{settings.server_host}:{settings.server_port}/v1/references" + base_url = f"{settings.website_address}/v1/references" lines = [] for key, values in data.items(): for value in values: