Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
43 |
-
chain =
|
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.
|