Spaces:
Sleeping
Sleeping
Update app.py
Browse filesdebugging file uploader
app.py
CHANGED
|
@@ -126,16 +126,16 @@ with tab2:
|
|
| 126 |
raw_text = extract_text(temp_file.name)
|
| 127 |
text = str(raw_text)
|
| 128 |
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
|
| 140 |
st.markdown("<br><br><br><br><br>", unsafe_allow_html=True)
|
| 141 |
|
|
|
|
| 126 |
raw_text = extract_text(temp_file.name)
|
| 127 |
text = str(raw_text)
|
| 128 |
|
| 129 |
+
question = st.text_input(label="Enter your question")
|
| 130 |
+
context = st.text_area("Your essay context: ", value=text, height=330)
|
| 131 |
+
|
| 132 |
+
# perform question answering when "get answer" button clicked
|
| 133 |
+
button2 = st.button("Get answer", key="fileInput")
|
| 134 |
+
if button2:
|
| 135 |
+
if context=="" or question=="":
|
| 136 |
+
st.error ("Please enter BOTH the context and the question", icon="🚨")
|
| 137 |
+
else:
|
| 138 |
+
question_answering(context, question)
|
| 139 |
|
| 140 |
st.markdown("<br><br><br><br><br>", unsafe_allow_html=True)
|
| 141 |
|