ivnban27-ctl commited on
Commit
a139603
·
1 Parent(s): 92dff98

progress bar instead of spinner

Browse files
Files changed (2) hide show
  1. app_config.py +1 -1
  2. pages/training_adherence.py +12 -5
app_config.py CHANGED
@@ -48,7 +48,7 @@ def source2label(source):
48
  def issue2label(issue):
49
  return seed2str.get(issue, "GCT")
50
 
51
- ENVIRON = "prod"
52
 
53
  DB_SCHEMA = 'prod_db' if ENVIRON == 'prod' else 'test_db'
54
  DB_CONVOS = 'conversations'
 
48
  def issue2label(issue):
49
  return seed2str.get(issue, "GCT")
50
 
51
+ ENVIRON = "dev"
52
 
53
  DB_SCHEMA = 'prod_db' if ENVIRON == 'prod' else 'test_db'
54
  DB_CONVOS = 'conversations'
pages/training_adherence.py CHANGED
@@ -8,17 +8,20 @@ from models.ta_models.config import QUESTION2PHASE, NAME2QUESTION, TA_OPTIONS
8
 
9
  st.set_page_config(page_title="Conversation Simulator - Scoring")
10
 
11
- if "memory" not in st.session_state:
12
- st.switch_page("pages/convosim.py")
13
-
14
  if not are_models_alive():
15
  st.switch_page("pages/model_loader.py")
16
 
 
 
 
17
  memory = st.session_state['memory']
18
- @st.cache_data(show_spinner="Retrieving responses from the server ...")
 
 
19
  def get_ta_responses():
 
20
  data = defaultdict(defaultdict)
21
- for question in QUESTION2PHASE.keys():
22
  # responses = ["Yes, The helper showed some respect.",
23
  # "Yes. The helper is good! No doubt",
24
  # "N/A, Texter disengaged.",
@@ -29,6 +32,10 @@ def get_ta_responses():
29
  response, explanation = post_process_response(full_response)
30
  data[question]["response"] = response
31
  data[question]["explanation"] = explanation
 
 
 
 
32
  return data
33
 
34
  with st.container():
 
8
 
9
  st.set_page_config(page_title="Conversation Simulator - Scoring")
10
 
 
 
 
11
  if not are_models_alive():
12
  st.switch_page("pages/model_loader.py")
13
 
14
+ if "memory" not in st.session_state:
15
+ st.switch_page("pages/convosim.py")
16
+
17
  memory = st.session_state['memory']
18
+ progress_text = "Scoring Conversation using AI models ..."
19
+
20
+ @st.cache_data(show_spinner=False)
21
  def get_ta_responses():
22
+ my_bar = st.progress(0, text=progress_text)
23
  data = defaultdict(defaultdict)
24
+ for i, question in enumerate(QUESTION2PHASE.keys()):
25
  # responses = ["Yes, The helper showed some respect.",
26
  # "Yes. The helper is good! No doubt",
27
  # "N/A, Texter disengaged.",
 
32
  response, explanation = post_process_response(full_response)
33
  data[question]["response"] = response
34
  data[question]["explanation"] = explanation
35
+ my_bar.progress((i+1) / len(QUESTION2PHASE.keys()), text = progress_text)
36
+ import time
37
+ time.sleep(2)
38
+ my_bar.empty()
39
  return data
40
 
41
  with st.container():