Redmind commited on
Commit
16af574
·
verified ·
1 Parent(s): c02416d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -12,10 +12,14 @@ import chromadb
12
 
13
  app = FastAPI()
14
  client = chromadb.PersistentClient(path="/data/chroma_db")
15
- collection = client.get_collection(name="knowledge_base")
16
  pdf_file="Sutures and Suturing techniques.pdf"
17
  pptx_file="impalnt 1.pptx"
18
  process_and_store(pdf_path=pdf_file, pptx_path=pptx_file)
 
 
 
 
19
 
20
  # Initialize models
21
  text_model = SentenceTransformer('all-MiniLM-L6-v2')
 
12
 
13
  app = FastAPI()
14
  client = chromadb.PersistentClient(path="/data/chroma_db")
15
+ collection = client.get_or_create_collection(name="knowledge_base")
16
  pdf_file="Sutures and Suturing techniques.pdf"
17
  pptx_file="impalnt 1.pptx"
18
  process_and_store(pdf_path=pdf_file, pptx_path=pptx_file)
19
+ collections = client.list_collections()
20
+
21
+ print("Existing Collections:", [c.name for c in collections])
22
+ collection = client.get_collection(name="knowledge_base")
23
 
24
  # Initialize models
25
  text_model = SentenceTransformer('all-MiniLM-L6-v2')