Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,9 +50,9 @@ if option == "Extractive question answering":
|
|
| 50 |
elif source == "I want to upload a file":
|
| 51 |
uploaded_file = st.file_uploader("Choose a .txt file to upload", type=["txt"])
|
| 52 |
if uploaded_file is not None:
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
question = st.text_input(label="Enter your question")
|
| 57 |
button = st.button("Get answer")
|
| 58 |
if button:
|
|
|
|
| 50 |
elif source == "I want to upload a file":
|
| 51 |
uploaded_file = st.file_uploader("Choose a .txt file to upload", type=["txt"])
|
| 52 |
if uploaded_file is not None:
|
| 53 |
+
stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
|
| 54 |
+
string_data = stringio.read()
|
| 55 |
+
context = st.text_area("", value=string_data, height=330)
|
| 56 |
question = st.text_input(label="Enter your question")
|
| 57 |
button = st.button("Get answer")
|
| 58 |
if button:
|