mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
docs(vectorstores/integrations/chroma): Fix loading and saving (#7437)
- Description: Fix loading and saving code about Chroma - Issue: the issue #7436 - Dependencies: - - Twitter handle: https://twitter.com/ftnext
This commit is contained in:
parent
c7f7788d0b
commit
dfc3f83b0f
@ -146,11 +146,11 @@
|
|||||||
"# save to disk\n",
|
"# save to disk\n",
|
||||||
"db2 = Chroma.from_documents(docs, embedding_function, persist_directory=\"./chroma_db\")\n",
|
"db2 = Chroma.from_documents(docs, embedding_function, persist_directory=\"./chroma_db\")\n",
|
||||||
"db2.persist()\n",
|
"db2.persist()\n",
|
||||||
"docs = db.similarity_search(query)\n",
|
"docs = db2.similarity_search(query)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# load from disk\n",
|
"# load from disk\n",
|
||||||
"db3 = Chroma(persist_directory=\"./chroma_db\")\n",
|
"db3 = Chroma(persist_directory=\"./chroma_db\", embedding_function=embedding_function)\n",
|
||||||
"docs = db.similarity_search(query)\n",
|
"docs = db3.similarity_search(query)\n",
|
||||||
"print(docs[0].page_content)"
|
"print(docs[0].page_content)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user