Ridealist commited on
Commit
605babd
1 Parent(s): 531458e

refactor: show console print & adjusting minor feature for UI

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -19,7 +19,7 @@ from modules.setting_modules import blockPrint
19
  #########################################################
20
  # Disabled Console print
21
  #########################################################
22
- blockPrint()
23
 
24
  #########################################################
25
  # GET DB
@@ -477,7 +477,7 @@ def generate_response(prompt):
477
  st.session_state['user_debate_history'].append(prompt)
478
  st.session_state['total_debate_history'].append({"role": "user", "content": prompt})
479
 
480
- if len(prompt.split()) < 10:
481
  response = "Please speak longer!"
482
  else:
483
  response = gpt_call_context(st.session_state['total_debate_history'])
@@ -702,7 +702,6 @@ def page5():
702
  on_click=page_5_6_controller
703
  )
704
 
705
- #TODO must have to delete!!!!
706
  print("#"*80)
707
  pprint.pprint(st.session_state.to_dict())
708
  print("#"*80)
@@ -724,8 +723,7 @@ def page6():
724
 
725
  # st.tab
726
  st.header('Total Debate Evaluation')
727
-
728
- st.write('Note that evaluation using GPT is an experimental feature. Please check it out and give us your feedback.')
729
 
730
  tab1, tab2 = st.tabs(['Debate Evaluation', 'Debate Analysis']) ## Delete 'Perfect Case'
731
 
@@ -736,7 +734,7 @@ def page6():
736
  #judgement_who = st.selectbox("Choose what you want! (Evaluation result / Perfect case on this theme)", debate_themes)
737
 
738
  if st.session_state.judgement_result == "":
739
- with st.spinner('Wait for judgement result...'):
740
  judgement_result = ""
741
 
742
  user_debate_history = "".join(
@@ -995,7 +993,6 @@ pages = {
995
  }
996
 
997
  selection = st.session_state.page
998
- #TODO delete!
999
  print("selection:", selection)
1000
 
1001
  page = pages[selection]
 
19
  #########################################################
20
  # Disabled Console print
21
  #########################################################
22
+ # blockPrint()
23
 
24
  #########################################################
25
  # GET DB
 
477
  st.session_state['user_debate_history'].append(prompt)
478
  st.session_state['total_debate_history'].append({"role": "user", "content": prompt})
479
 
480
+ if len(prompt.split()) < 5:
481
  response = "Please speak longer!"
482
  else:
483
  response = gpt_call_context(st.session_state['total_debate_history'])
 
702
  on_click=page_5_6_controller
703
  )
704
 
 
705
  print("#"*80)
706
  pprint.pprint(st.session_state.to_dict())
707
  print("#"*80)
 
723
 
724
  # st.tab
725
  st.header('Total Debate Evaluation')
726
+ st.caption('📢 Note that evaluation using GPT is an experimental feature. Please check it out and give us your feedback.')
 
727
 
728
  tab1, tab2 = st.tabs(['Debate Evaluation', 'Debate Analysis']) ## Delete 'Perfect Case'
729
 
 
734
  #judgement_who = st.selectbox("Choose what you want! (Evaluation result / Perfect case on this theme)", debate_themes)
735
 
736
  if st.session_state.judgement_result == "":
737
+ with st.spinner('Wait for result...'):
738
  judgement_result = ""
739
 
740
  user_debate_history = "".join(
 
993
  }
994
 
995
  selection = st.session_state.page
 
996
  print("selection:", selection)
997
 
998
  page = pages[selection]