samim2024 commited on
Commit
ec2a1c4
·
verified ·
1 Parent(s): 89478cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 new_db
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=new_db.as_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