OOlajide commited on
Commit
8bfdd29
·
1 Parent(s): c255465

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -50,9 +50,8 @@ 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
- 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:
 
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
+ raw_text = str(uploaded_file.read(),"utf-8")
54
+ context = st.text_area("", value=raw_text, height=330)
 
55
  question = st.text_input(label="Enter your question")
56
  button = st.button("Get answer")
57
  if button: