Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -69,7 +69,7 @@ def create_langchain_index(input_text):
|
|
69 |
documents=docs, embedding=embeddings, persist_directory=persist_directory
|
70 |
)
|
71 |
new_db = Chroma(persist_directory=persist_directory, embedding_function=embeddings)
|
72 |
-
return
|
73 |
|
74 |
# @st.cache_resource
|
75 |
# def get_basic_page_details(input_text,summary_query,tweet_query,ln_query):
|
@@ -84,7 +84,7 @@ def create_langchain_index(input_text):
|
|
84 |
@st.cache_data
|
85 |
def get_response(input_text,query):
|
86 |
print(f"--querying---{query}")
|
87 |
-
retrieval_chain = RetrievalQA.from_chain_type(llm, chain_type="stuff", retriever=
|
88 |
response = retrieval_chain.run(query)
|
89 |
#response = index.query(query,llm=llm)
|
90 |
return response
|
|
|
69 |
documents=docs, embedding=embeddings, persist_directory=persist_directory
|
70 |
)
|
71 |
new_db = Chroma(persist_directory=persist_directory, embedding_function=embeddings)
|
72 |
+
return db
|
73 |
|
74 |
# @st.cache_resource
|
75 |
# def get_basic_page_details(input_text,summary_query,tweet_query,ln_query):
|
|
|
84 |
@st.cache_data
|
85 |
def get_response(input_text,query):
|
86 |
print(f"--querying---{query}")
|
87 |
+
retrieval_chain = RetrievalQA.from_chain_type(llm, chain_type="stuff", retriever=db.as_retriever())
|
88 |
response = retrieval_chain.run(query)
|
89 |
#response = index.query(query,llm=llm)
|
90 |
return response
|