zamal commited on
Commit
6293633
·
verified ·
1 Parent(s): 6d3678b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -17,7 +17,7 @@ from PIL import Image
17
  from pypdf import PdfReader
18
  from dotenv import load_dotenv
19
  import shutil
20
- from chromadb.config import Settings
21
  from welcome_text import WELCOME_INTRO
22
 
23
  from doctr.io import DocumentFile
@@ -106,11 +106,12 @@ def get_vectordb(text: str, images: list[Image.Image], img_names: list[str]):
106
  shutil.rmtree(PERSIST_DIR, ignore_errors=True)
107
  os.makedirs(PERSIST_DIR, exist_ok=True)
108
 
109
- # 2) Persistent client
110
- client = chromadb.Client(Settings(
111
- chroma_db_impl="duckdb+parquet",
112
- persist_directory=PERSIST_DIR
113
- ))
 
114
 
115
  # 3) Create / wipe collections
116
  for col in ("text_db", "image_db"):
 
17
  from pypdf import PdfReader
18
  from dotenv import load_dotenv
19
  import shutil
20
+ from chromadb.config import Settings, DEFAULT_TENANT, DEFAULT_DATABASE
21
  from welcome_text import WELCOME_INTRO
22
 
23
  from doctr.io import DocumentFile
 
106
  shutil.rmtree(PERSIST_DIR, ignore_errors=True)
107
  os.makedirs(PERSIST_DIR, exist_ok=True)
108
 
109
+ client = chromadb.PersistentClient(
110
+ path=PERSIST_DIR,
111
+ settings=Settings(),
112
+ tenant=DEFAULT_TENANT,
113
+ database=DEFAULT_DATABASE
114
+ )
115
 
116
  # 3) Create / wipe collections
117
  for col in ("text_db", "image_db"):