Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,9 +15,15 @@ embedding_function = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
|
|
| 15 |
loader = JSONLoader(file_path="games.json", jq_schema=".games[]", text_content=False)
|
| 16 |
documents = loader.load()
|
| 17 |
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
search_type="mmr",
|
| 22 |
search_kwargs={'k': 300, 'fetch_k': 500}
|
| 23 |
)
|
|
|
|
| 15 |
loader = JSONLoader(file_path="games.json", jq_schema=".games[]", text_content=False)
|
| 16 |
documents = loader.load()
|
| 17 |
|
| 18 |
+
persist_directory = "./chroma_langchain_db"
|
| 19 |
+
vectordb = Chroma.from_documents(documents, embedding_function, persist_directory=persist_directory)
|
| 20 |
|
| 21 |
+
vectordb_loaded = Chroma(
|
| 22 |
+
persist_directory=persist_directory,
|
| 23 |
+
embedding_function=embedding_function
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
retriever = vectordb_loaded.as_retriever(
|
| 27 |
search_type="mmr",
|
| 28 |
search_kwargs={'k': 300, 'fetch_k': 500}
|
| 29 |
)
|