annafilina commited on
Commit
3d1ce66
·
1 Parent(s): 3869412

Update pages/answers.py

Browse files
Files changed (1) hide show
  1. pages/answers.py +4 -4
pages/answers.py CHANGED
@@ -61,14 +61,14 @@ def main():
61
  pair = random.choice(pairs)
62
  st.session_state['Context'] = pair['context']
63
  st.session_state['Question'] = pair['question']
 
 
64
 
65
  random_button = st.button('Random Example', on_click=random_button_callback)
66
 
67
- if random_button:
68
- context = st.text_area("**:blue[Context]**", st.session_state['Context'], key='RandomContext')
69
- question = st.text_input("**:blue[Question]**", st.session_state['Question'], key='RandomQuestion')
70
-
71
  if st.button(":blue[**Get Answer**]"):
 
 
72
  if context.strip() == "" or question.strip() == "":
73
  st.warning("Please enter the context and question.")
74
  else:
 
61
  pair = random.choice(pairs)
62
  st.session_state['Context'] = pair['context']
63
  st.session_state['Question'] = pair['question']
64
+ st.text_area("**:blue[Context]**", st.session_state['Context'], key='Context')
65
+ st.text_input("**:blue[Question]**", st.session_state['Question'], key='Question')
66
 
67
  random_button = st.button('Random Example', on_click=random_button_callback)
68
 
 
 
 
 
69
  if st.button(":blue[**Get Answer**]"):
70
+ context = st.session_state['Context']
71
+ question = st.session_state['Question']
72
  if context.strip() == "" or question.strip() == "":
73
  st.warning("Please enter the context and question.")
74
  else: