annafilina commited on
Commit
f5bdc5b
·
1 Parent(s): 0d460f6

Update pages/answers.py

Browse files
Files changed (1) hide show
  1. pages/answers.py +5 -2
pages/answers.py CHANGED
@@ -67,10 +67,13 @@ def main():
67
  context_placeholder = "Enter the context here..."
68
  question_placeholder = "Enter the question here..."
69
 
70
- context = st.text_area("**:blue[Context]**", context_placeholder, key='Context')
71
- question = st.text_input("**:blue[Question]**", question_placeholder, key='Question')
72
 
73
  if random_button:
 
 
 
74
  context = st.text_area("**:blue[Context]**", st.session_state['Context'], key='RandomContext')
75
  question = st.text_input("**:blue[Question]**", st.session_state['Question'], key='RandomQuestion')
76
 
 
67
  context_placeholder = "Enter the context here..."
68
  question_placeholder = "Enter the question here..."
69
 
70
+ context = st.text_area("**:blue[Context]**", st.session_state['Context'], key='Context')
71
+ question = st.text_input("**:blue[Question]**", st.session_state['Question'], key='Question')
72
 
73
  if random_button:
74
+ pair = random.choice(pairs)
75
+ st.session_state['Context'] = pair['context']
76
+ st.session_state['Question'] = pair['question']
77
  context = st.text_area("**:blue[Context]**", st.session_state['Context'], key='RandomContext')
78
  question = st.text_input("**:blue[Question]**", st.session_state['Question'], key='RandomQuestion')
79