line got moved somehow

Signed-off-by: Matt Williams <m@technovangelist.com>
This commit is contained in:
Matt Williams 2024-09-17 16:26:59 -07:00
parent 505f84a93e
commit 86670dfbac

View file

@ -1,12 +1,17 @@
import chromadb
from functions import readtextfiles, chunksplitter, getembedding
chromaclient = chromadb.HttpClient(host="localhost", port=8000)
textdocspath = "../../scripts"
text_data = readtextfiles(textdocspath)
collection = chromaclient.get_or_create_collection(name="buildragwithpython", metadata={"hnsw:space": "cosine"} )
if any(collection.name == collectionname for collection in chromaclient.list_collections()):
chromaclient.delete_collection("buildragwithpython")
collection = chromaclient.get_or_create_collection(name="buildragwithpython", metadata={"hnsw:space": "cosine"} )
for filename, text in text_data.items():
chunks = chunksplitter(text)
embeds = getembedding(chunks)