From decac3f1502835d73c4b14954bcd091b86bb835f Mon Sep 17 00:00:00 2001 From: faraphel Date: Thu, 23 Jan 2025 08:42:30 +0100 Subject: [PATCH] improved ChatInterface display --- source/api/Application.py | 4 ++++ source/api/interface/ChatInterface.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/source/api/Application.py b/source/api/Application.py index 9a4328e..9210073 100644 --- a/source/api/Application.py +++ b/source/api/Application.py @@ -12,5 +12,9 @@ class Application(fastapi.FastAPI): redoc_url=None, ) + async def on_shutdown(self): + print("Shutdown event detected.") + def serve(self, host: str = "0.0.0.0", port: int = 8080): + self.add_event_handler("shutdown", self.on_shutdown) uvicorn.run(self, host=host, port=port) \ No newline at end of file diff --git a/source/api/interface/ChatInterface.py b/source/api/interface/ChatInterface.py index a4542a6..669536f 100644 --- a/source/api/interface/ChatInterface.py +++ b/source/api/interface/ChatInterface.py @@ -53,6 +53,10 @@ class ChatInterface(base.BaseInterface): gradio.Markdown(textwrap.dedent(f""" # {meta.name} ## {self.model.name} + + > {self.model.summary} + + {self.model.description} """)) # additional settings