mirror of
https://github.com/technovangelist/videoprojects.git
synced 2026-09-10 07:16:19 -04:00
fix: you can only delete something that might exist
Signed-off-by: Matt Williams <m@technovangelist.com>
This commit is contained in:
parent
e42f53623a
commit
b2a2cfcb40
|
|
@ -2,9 +2,13 @@ import ollama, chromadb, time
|
|||
from utilities import readtext, getconfig
|
||||
from mattsollamatools import chunker, chunk_text_by_sentences
|
||||
|
||||
collectionname="buildragwithpython"
|
||||
|
||||
chroma = chromadb.HttpClient(host="localhost", port=8000)
|
||||
chroma.delete_collection("buildragwithpython")
|
||||
print(chroma.list_collections())
|
||||
if any(collection.name == collectionname for collection in chroma.list_collections()):
|
||||
print('deleting collection')
|
||||
chroma.delete_collection("buildragwithpython")
|
||||
collection = chroma.get_or_create_collection(name="buildragwithpython", metadata={"hnsw:space": "cosine"})
|
||||
|
||||
embedmodel = getconfig()["embedmodel"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue