Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,7 +52,7 @@ def main():
|
|
| 52 |
length_function=len
|
| 53 |
)
|
| 54 |
chunks = text_splitter.split_text(text=text)
|
| 55 |
-
|
| 56 |
|
| 57 |
# embeddings
|
| 58 |
embeddings = HuggingFaceEmbeddings()
|
|
@@ -71,7 +71,7 @@ def main():
|
|
| 71 |
if query == 'Summarize':
|
| 72 |
#docs = pdf_reader.load_and_split()
|
| 73 |
chain = load_summarize_chain(llm, chain_type="map_reduce")
|
| 74 |
-
response = chain.run(
|
| 75 |
else:
|
| 76 |
docs = vector_store.similarity_search(query=query, k=2)
|
| 77 |
#st.write(docs)
|
|
|
|
| 52 |
length_function=len
|
| 53 |
)
|
| 54 |
chunks = text_splitter.split_text(text=text)
|
| 55 |
+
chunks_doc = text_splitter.create_documents(text)
|
| 56 |
|
| 57 |
# embeddings
|
| 58 |
embeddings = HuggingFaceEmbeddings()
|
|
|
|
| 71 |
if query == 'Summarize':
|
| 72 |
#docs = pdf_reader.load_and_split()
|
| 73 |
chain = load_summarize_chain(llm, chain_type="map_reduce")
|
| 74 |
+
response = chain.run(chunks_doc)
|
| 75 |
else:
|
| 76 |
docs = vector_store.similarity_search(query=query, k=2)
|
| 77 |
#st.write(docs)
|