Update app.py
Browse files
app.py
CHANGED
|
@@ -29,6 +29,13 @@ os.environ["LANGCHAIN_ENDPOINT"] = "https://api.langchain.plus"
|
|
| 29 |
os.environ["LANGCHAIN_API_KEY"] = lang_api_key
|
| 30 |
os.environ["LANGCHAIN_PROJECT"] = "Lithuanian_Law_RAG_QA"
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
|
| 34 |
def create_retriever_from_chroma(vectorstore_path="./docs/chroma/", search_type='mmr', k=7, chunk_size=250, chunk_overlap=20):
|
|
@@ -168,5 +175,5 @@ def create_conversational_rag_chain(retriever):
|
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
-
if __name__ == "__main__":
|
| 172 |
-
main()
|
|
|
|
| 29 |
os.environ["LANGCHAIN_API_KEY"] = lang_api_key
|
| 30 |
os.environ["LANGCHAIN_PROJECT"] = "Lithuanian_Law_RAG_QA"
|
| 31 |
|
| 32 |
+
def remove_directory(path):
|
| 33 |
+
if os.path.exists(path):
|
| 34 |
+
shutil.rmtree(path)
|
| 35 |
+
print(f"Directory {path} removed successfully.")
|
| 36 |
+
else:
|
| 37 |
+
print(f"Directory {path} does not exist.")
|
| 38 |
+
|
| 39 |
|
| 40 |
|
| 41 |
def create_retriever_from_chroma(vectorstore_path="./docs/chroma/", search_type='mmr', k=7, chunk_size=250, chunk_overlap=20):
|
|
|
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
+
#if __name__ == "__main__":
|
| 179 |
+
# main()
|