Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
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"):
|