Skip to content

Commit

Permalink
improve checking_model output UI
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelClifford committed Feb 14, 2024
1 parent 56c4da5 commit 0c1e548
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions chatbot-langchain/chatbot_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 0c1e548

Please sign in to comment.