demoPOC commited on
Commit
a8d3828
·
1 Parent(s): 9777155

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -39,8 +39,8 @@ documents= loader.load()
39
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=1500, chunk_overlap=150)
40
  texts = text_splitter.split_documents(documents)
41
  embeddings = OpenAIEmbeddings()
42
- doc_search = Chroma.from_documents(texts,embeddings)
43
- chain = VectorDBQA.from_chain_type(llm=OpenAI(temperature=0.0), chain_type="stuff", vectorstore=doc_search)
44
 
45
  app = flask.Flask(__name__, template_folder="./")
46
  # Create a directory in a known location to save files to.
 
39
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=1500, chunk_overlap=150)
40
  texts = text_splitter.split_documents(documents)
41
  embeddings = OpenAIEmbeddings()
42
+ vectordb = Chroma.from_documents(texts,embeddings)
43
+ chain = RetrievalQA.from_chain_type(llm=OpenAI(temperature=0.0),chain_type="stuff", retriever=vectordb.as_retriever(),return_source_documents=True)
44
 
45
  app = flask.Flask(__name__, template_folder="./")
46
  # Create a directory in a known location to save files to.