From 0c1e5487641587f4a8f36b8eadd62a191d491fde Mon Sep 17 00:00:00 2001 From: Michael Clifford Date: Wed, 14 Feb 2024 11:25:09 -0500 Subject: [PATCH] improve checking_model output UI --- chatbot-langchain/chatbot_ui.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chatbot-langchain/chatbot_ui.py b/chatbot-langchain/chatbot_ui.py index 20edbd63..cc8e696b 100644 --- a/chatbot-langchain/chatbot_ui.py +++ b/chatbot-langchain/chatbot_ui.py @@ -10,8 +10,9 @@ model_service = os.getenv("MODEL_SERVICE_ENDPOINT", "http://localhost:8001/v1") -@st.cache_resource +@st.cache_resource(show_spinner=False) def checking_model_service(): + start = time.time() print("Checking Model Service Availability...") ready = False while not ready: @@ -23,8 +24,10 @@ def checking_model_service(): pass time.sleep(1) print("Model Service Available") + print(f"{time.time()-start} seconds") -checking_model_service() +with st.spinner("Checking Model Service Availability..."): + checking_model_service() st.title("💬 Chatbot") if "messages" not in st.session_state: