Spaces:
Sleeping
Sleeping
Update app.py
Browse files123 unmodified lines12412512612712812913013113213313413513613713813914014112714312812913013113213313413513613713813914014114214314414514653 unmodified lines200201202203203204205206207208209210211212213214215216217218219220221123 unmodified linesif 'success' not in st.session_state: st.session_state.success = None
if st.session_state.error != "": st.error(st.session_state.error)
if st.session_state.success != None: st.success("Success! Download the Q/A pairs below / Click reset to upload more PDFs") st.download_button( label="Download CSV", data=st.session_state.success, file_name='questions_answers.csv', mime='text/csv', ) if st.button('Reset'): st.session_state.clear() st.rerun()
if selected_app == "1) Create CSVs": if not st.session_state.success: if st.session_state.error != "": st.error(st.session_state.error) if st.session_state.success != None: st.success("Success! Download the Q/A pairs below / Click reset to upload more PDFs") st.download_button( label="Download CSV", data=st.session_state.success, file_name='questions_answers.csv', mime='text/csv', ) if st.button('Reset'): st.session_state.clear() st.rerun() else: uploaded_files = st.file_uploader("Upload PDFs Here", type="pdf", accept_multiple_files=True) question_protocol = st.text_input("Provide instructions for how questions should be generated", "Write a question based on the text")53 unmodified lines st.rerun()
if selected_app == "2) Merge CSVs": if not st.session_state.success: if st.session_state.error != "": st.error(st.session_state.error) if st.session_state.success != None: st.success("Success! Download the merged CSV with Q/A pairs below / Reset to merge more CSVs") st.download_button( label="Download CSV", data=st.session_state.success, file_name='questions_answers.csv', mime='text/csv', ) if st.button('Reset'): st.session_state.clear() st.rerun() else: uploaded_files = st.file_uploader("Upload CSV files to merge", accept_multiple_files=True, type="csv") submit = st.button("Submit")app.py+32-17