File size: 561 Bytes
7217024
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import chromadb

# Path where your Chroma DB is stored
CHROMA_PATH = "chromadb-store"
COLLECTION_NAME = "vishnu_sahasranamam"

# Initialize Chroma client
client = chromadb.PersistentClient(path=CHROMA_PATH)

# Check and delete the collection if it exists
collections = [c.name for c in client.list_collections()]

if COLLECTION_NAME in collections:
    client.delete_collection(name=COLLECTION_NAME)
    print(f"✅ Deleted collection '{COLLECTION_NAME}' from {CHROMA_PATH}")
else:
    print(f"⚠️ Collection '{COLLECTION_NAME}' not found in {CHROMA_PATH}")