Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,10 +12,14 @@ import chromadb
|
|
| 12 |
|
| 13 |
app = FastAPI()
|
| 14 |
client = chromadb.PersistentClient(path="/data/chroma_db")
|
| 15 |
-
collection = client.
|
| 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')
|