From 3ea31930e57a45a0806488950e841efbb575369a Mon Sep 17 00:00:00 2001 From: Gabor Date: Sun, 11 Jun 2023 00:58:08 +0100 Subject: [PATCH] fixes abetlen/llama-cpp-python #358 --- llama_cpp/server/__main__.py | 2 +- llama_cpp/server/app.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/llama_cpp/server/__main__.py b/llama_cpp/server/__main__.py index 4fe1d94..1de4548 100644 --- a/llama_cpp/server/__main__.py +++ b/llama_cpp/server/__main__.py @@ -46,5 +46,5 @@ if __name__ == "__main__": app = create_app(settings=settings) uvicorn.run( - app, host=os.getenv("HOST", "localhost"), port=int(os.getenv("PORT", 8000)) + app, host=settings.host, port=settings.port ) diff --git a/llama_cpp/server/app.py b/llama_cpp/server/app.py index f70d8f0..2191005 100644 --- a/llama_cpp/server/app.py +++ b/llama_cpp/server/app.py @@ -72,6 +72,12 @@ class Settings(BaseSettings): verbose: bool = Field( default=True, description="Whether to print debug information." ) + host: str = Field( + default="localhost", description="Listen address" + ) + port: int = Field( + default=8000, description="Listen port" + ) router = APIRouter()