Spaces:
Sleeping
Sleeping
Commit
·
a6237f8
1
Parent(s):
680c85b
Update pages/answers.py
Browse files- pages/answers.py +3 -3
pages/answers.py
CHANGED
@@ -65,7 +65,7 @@ def main():
|
|
65 |
|
66 |
context_placeholder = "Enter the context here..."
|
67 |
question_placeholder = "Enter the question here..."
|
68 |
-
|
69 |
context = st.text_area("**:blue[Context]**", context_placeholder)
|
70 |
question = st.text_input("**:blue[Question]**", question_placeholder)
|
71 |
|
@@ -73,12 +73,12 @@ def main():
|
|
73 |
pair = random.choice(pairs)
|
74 |
context = pair['context']
|
75 |
question = pair['question']
|
76 |
-
|
77 |
st.text_area("**:blue[Context]**", context)
|
78 |
st.text_input("**:blue[Question]**", question)
|
79 |
|
80 |
if st.button(":blue[**Get Answer**]"):
|
81 |
-
if context.strip() ==
|
82 |
st.warning("Please enter the context and question.")
|
83 |
else:
|
84 |
answer = get_answer(context, question)
|
|
|
65 |
|
66 |
context_placeholder = "Enter the context here..."
|
67 |
question_placeholder = "Enter the question here..."
|
68 |
+
|
69 |
context = st.text_area("**:blue[Context]**", context_placeholder)
|
70 |
question = st.text_input("**:blue[Question]**", question_placeholder)
|
71 |
|
|
|
73 |
pair = random.choice(pairs)
|
74 |
context = pair['context']
|
75 |
question = pair['question']
|
76 |
+
|
77 |
st.text_area("**:blue[Context]**", context)
|
78 |
st.text_input("**:blue[Question]**", question)
|
79 |
|
80 |
if st.button(":blue[**Get Answer**]"):
|
81 |
+
if context.strip() == "" or question.strip() == "":
|
82 |
st.warning("Please enter the context and question.")
|
83 |
else:
|
84 |
answer = get_answer(context, question)
|