Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -352,14 +352,13 @@ if user_question:
|
|
352 |
|
353 |
with st.sidebar:
|
354 |
st.subheader("Your documents")
|
355 |
-
|
356 |
-
#if st.button("Process"):
|
357 |
with st.spinner("Processing"):
|
358 |
-
|
359 |
-
text_chunks = split_text_into_chunks(
|
360 |
vectorstore = create_vector_store_from_text_chunks(text_chunks)
|
361 |
st.session_state.conversation = create_conversation_chain(vectorstore)
|
362 |
-
|
363 |
-
st.markdown('# Extracted Text of Length:' +
|
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, '')
|