awacke1 commited on
Commit
5c6c4fa
·
1 Parent(s): cd6ca24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -352,14 +352,13 @@ if user_question:
352
 
353
  with st.sidebar:
354
  st.subheader("Your documents")
355
- pdf_docs = st.file_uploader("Upload your PDFs here and click on 'Process'", accept_multiple_files=True)
356
- #if st.button("Process"):
357
  with st.spinner("Processing"):
358
- raw_text = extract_text_from_pdfs(pdf_docs)
359
- text_chunks = split_text_into_chunks(raw_text)
360
  vectorstore = create_vector_store_from_text_chunks(text_chunks)
361
  st.session_state.conversation = create_conversation_chain(vectorstore)
362
- lenOfVectorStore = len(vectorstore)
363
- st.markdown('# Extracted Text of Length:' + str(raw_text) + ' and Created Search Index')
364
  filename = generate_filename(file_content_area, choice)
365
  create_file(filename, raw_text, '')
 
352
 
353
  with st.sidebar:
354
  st.subheader("Your documents")
355
+ docs = st.file_uploader("Upload your documents", accept_multiple_files=True)
 
356
  with st.spinner("Processing"):
357
+ raw = extract_text_from_pdfs(docs)
358
+ text_chunks = split_text_into_chunks(raw)
359
  vectorstore = create_vector_store_from_text_chunks(text_chunks)
360
  st.session_state.conversation = create_conversation_chain(vectorstore)
361
+ length = str(len(raw))
362
+ st.markdown('# Extracted Text of Length:' + length + ' and Created Search Index')
363
  filename = generate_filename(file_content_area, choice)
364
  create_file(filename, raw_text, '')