Paul-Joshi commited on
Commit
ac0a4b5
·
verified ·
1 Parent(s): 4899fe2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -37,7 +37,7 @@ def method_get_vectorstore(document_chunks):
37
  vector_store = Chroma.from_documents(document_chunks, embeddings)
38
  return vector_store
39
 
40
- def get_context_retriever_chain(vector_store):
41
  # Initialize the retriever
42
  retriever = vector_store.as_retriever()
43
 
@@ -61,7 +61,7 @@ def get_context_retriever_chain(vector_store):
61
  | StrOutputParser()
62
  )
63
 
64
- return after_rag_chain
65
 
66
  def main():
67
  st.set_page_config(page_title="Chat with websites", page_icon="🤖")
@@ -88,10 +88,8 @@ def main():
88
  doc_splits = method_get_text_chunks(raw_text)
89
  # create vector store
90
  vector_store = method_get_vectorstore(doc_splits)
91
- # st.write(doc_splits)
92
- retriever_chain = get_context_retriever_chain(vector_store)
93
  # Generate response using the RAG pipeline
94
- answer = retriever_chain.invoke(question)
95
  # Display the generated answer
96
  st.text_area("Answer", value=answer, height=300, disabled=True)
97
 
 
37
  vector_store = Chroma.from_documents(document_chunks, embeddings)
38
  return vector_store
39
 
40
+ def get_context_retriever_chain(vector_store,question):
41
  # Initialize the retriever
42
  retriever = vector_store.as_retriever()
43
 
 
61
  | StrOutputParser()
62
  )
63
 
64
+ return after_rag_chain.invoke(question)
65
 
66
  def main():
67
  st.set_page_config(page_title="Chat with websites", page_icon="🤖")
 
88
  doc_splits = method_get_text_chunks(raw_text)
89
  # create vector store
90
  vector_store = method_get_vectorstore(doc_splits)
 
 
91
  # Generate response using the RAG pipeline
92
+ answer = get_context_retriever_chain(vector_store,question)
93
  # Display the generated answer
94
  st.text_area("Answer", value=answer, height=300, disabled=True)
95