Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -355,10 +355,12 @@ with st.sidebar:
|
|
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 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
|
|
|
|
|
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 |
+
if len(raw) > 0:
|
359 |
+
length = str(len(raw))
|
360 |
+
text_chunks = split_text_into_chunks(raw)
|
361 |
+
vectorstore = create_vector_store_from_text_chunks(text_chunks)
|
362 |
+
st.session_state.conversation = create_conversation_chain(vectorstore)
|
363 |
+
st.markdown('# Extracted Text of Length:' + length + ' and Created Search Index')
|
364 |
+
filename = generate_filename(raw, choice)
|
365 |
+
create_file(filename, raw_text, '')
|
366 |
+
|