Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,7 +74,7 @@ import chromadb
|
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
-
@st.
|
| 78 |
def extract_text_from_pdf(pdf_path):
|
| 79 |
text = ""
|
| 80 |
reader = PdfReader(pdf_path)
|
|
@@ -528,7 +528,8 @@ def page3():
|
|
| 528 |
chroma_client = chromadb.Client()
|
| 529 |
|
| 530 |
# Check if the collection already exists
|
| 531 |
-
|
|
|
|
| 532 |
# Create the collection if it does not exist
|
| 533 |
collection = chroma_client.create_collection(name="Kosten_Strukturdaten0602204")
|
| 534 |
else:
|
|
|
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
+
@st.cache_data
|
| 78 |
def extract_text_from_pdf(pdf_path):
|
| 79 |
text = ""
|
| 80 |
reader = PdfReader(pdf_path)
|
|
|
|
| 528 |
chroma_client = chromadb.Client()
|
| 529 |
|
| 530 |
# Check if the collection already exists
|
| 531 |
+
existing_collections = chroma_client.list_collections()
|
| 532 |
+
if "Kosten_Strukturdaten0602204" not in existing_collections:
|
| 533 |
# Create the collection if it does not exist
|
| 534 |
collection = chroma_client.create_collection(name="Kosten_Strukturdaten0602204")
|
| 535 |
else:
|