Anne31415 commited on
Commit
8cced41
·
verified ·
1 Parent(s): 8805e7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -74,7 +74,7 @@ import chromadb
74
 
75
 
76
 
77
- @st.cache
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
- if "Kosten_Strukturdaten0602204" not in chroma_client.list_collections():
 
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: