alfraser commited on
Commit
38dd285
1 Parent(s): dfe6290

Updated to refresh every 10 seconds when an endpoint is starting up

Browse files
Files changed (1) hide show
  1. pages/900_System_Status.py +8 -0
pages/900_System_Status.py CHANGED
@@ -1,4 +1,5 @@
1
  import streamlit as st
 
2
 
3
  from src.st_helpers import st_setup
4
  from src.common import *
@@ -11,6 +12,7 @@ if st_setup('LLM Arch'):
11
  st.write("The following endpoints need to be running to run all the demonstrations.")
12
 
13
  endpoints = st.secrets['endpoints'].split(',')
 
14
 
15
  for i, e in enumerate(endpoints):
16
  status = hf_endpoint_status('alfraser', e)
@@ -39,9 +41,15 @@ if st_setup('LLM Arch'):
39
  resume_hf_endpoint('alfraser', e)
40
  st.rerun()
41
  else:
 
42
  with status_col:
43
  st.info(message)
44
  with button_col:
45
  if st.button("Pause", key=f'action_{i}'):
46
  pause_hf_endpoint('alfraser', e)
47
  st.rerun()
 
 
 
 
 
 
1
  import streamlit as st
2
+ import time
3
 
4
  from src.st_helpers import st_setup
5
  from src.common import *
 
12
  st.write("The following endpoints need to be running to run all the demonstrations.")
13
 
14
  endpoints = st.secrets['endpoints'].split(',')
15
+ refresh = False
16
 
17
  for i, e in enumerate(endpoints):
18
  status = hf_endpoint_status('alfraser', e)
 
41
  resume_hf_endpoint('alfraser', e)
42
  st.rerun()
43
  else:
44
+ refresh = True
45
  with status_col:
46
  st.info(message)
47
  with button_col:
48
  if st.button("Pause", key=f'action_{i}'):
49
  pause_hf_endpoint('alfraser', e)
50
  st.rerun()
51
+
52
+ if refresh:
53
+ with st.spinner('Updating every 10 seconds...'):
54
+ time.sleep(5)
55
+ st.rerun()