Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,6 +33,8 @@ def main():
|
|
| 33 |
|
| 34 |
docsearch = FAISS.from_documents(text_chunks, embeddings)
|
| 35 |
|
|
|
|
|
|
|
| 36 |
docsearch.save_local(DB_FAISS_PATH)
|
| 37 |
|
| 38 |
llm = CTransformers(model="models/llama-2-7b-chat.ggmlv3.q4_0.bin",
|
|
@@ -40,7 +42,7 @@ def main():
|
|
| 40 |
max_new_tokens=512,
|
| 41 |
temperature=0.1)
|
| 42 |
|
| 43 |
-
qa = ConversationalRetrievalChain.from_llm(llm, retriever=docsearch
|
| 44 |
|
| 45 |
result = qa(query)
|
| 46 |
st.write(result)
|
|
|
|
| 33 |
|
| 34 |
docsearch = FAISS.from_documents(text_chunks, embeddings)
|
| 35 |
|
| 36 |
+
docsearch = docsearch.as_retriever(search_type="similarity", search_kwargs={"k":1})
|
| 37 |
+
|
| 38 |
docsearch.save_local(DB_FAISS_PATH)
|
| 39 |
|
| 40 |
llm = CTransformers(model="models/llama-2-7b-chat.ggmlv3.q4_0.bin",
|
|
|
|
| 42 |
max_new_tokens=512,
|
| 43 |
temperature=0.1)
|
| 44 |
|
| 45 |
+
qa = ConversationalRetrievalChain.from_llm(llm, retriever=docsearch)
|
| 46 |
|
| 47 |
result = qa(query)
|
| 48 |
st.write(result)
|