Ines1994 commited on
Commit
92ec014
·
verified ·
1 Parent(s): 6c656e2

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -50,8 +50,14 @@ def render_sidebar():
50
 
51
  # DB Status
52
  try:
53
- col_data = engine.vectordb._collection.get(include=["documents"])
54
- db_count = len(col_data.get("documents", []))
 
 
 
 
 
 
55
  if db_count > 0:
56
  st.success(f"✅ المتوفر: {db_count} معلومة")
57
  else:
 
50
 
51
  # DB Status
52
  try:
53
+ db_count = 0
54
+ try:
55
+ col_data = engine.vectordb._collection.get(include=["documents"])
56
+ db_count = len(col_data.get("documents", []))
57
+ except:
58
+ # If collection get fails, we treat it as empty
59
+ db_count = 0
60
+
61
  if db_count > 0:
62
  st.success(f"✅ المتوفر: {db_count} معلومة")
63
  else: