mirror of
https://github.com/technovangelist/videoprojects.git
synced 2026-09-10 07:16:19 -04:00
line got moved somehow
Signed-off-by: Matt Williams <m@technovangelist.com>
This commit is contained in:
parent
505f84a93e
commit
86670dfbac
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue