Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -19,9 +19,12 @@ from langchain.chains import RetrievalQA
|
|
19 |
#loader = WebBaseLoader(web_links)
|
20 |
#documents = loader.load()
|
21 |
|
|
|
|
|
22 |
#texts = text_splitter.split_documents(documents)
|
23 |
-
db = Chroma.from_documents(
|
24 |
retriever = db.as_retriever()
|
|
|
25 |
global qa
|
26 |
qa = RetrievalQA.from_chain_type(llm=model_id, chain_type="stuff", retriever=retriever, return_source_documents=True)
|
27 |
|
|
|
19 |
#loader = WebBaseLoader(web_links)
|
20 |
#documents = loader.load()
|
21 |
|
22 |
+
db = Chroma(persist_directory="./chroma_db", embedding_function=embeddings)
|
23 |
+
db.get()
|
24 |
#texts = text_splitter.split_documents(documents)
|
25 |
+
#db = Chroma.from_documents(texts, embedding_function=embeddings)
|
26 |
retriever = db.as_retriever()
|
27 |
+
|
28 |
global qa
|
29 |
qa = RetrievalQA.from_chain_type(llm=model_id, chain_type="stuff", retriever=retriever, return_source_documents=True)
|
30 |
|