Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,27 +15,27 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
| 15 |
DB_PATH = os.path.join(BASE_DIR, "vector_db") # Ingest.py dagi bilan bir xil bo'lishi shart
|
| 16 |
DATA_PATH = os.path.join(BASE_DIR, "data")
|
| 17 |
|
| 18 |
-
st.sidebar.write("### Tizim holati:")
|
| 19 |
-
|
| 20 |
-
# 1. Avval 'data' papkasida PDF-lar borligini tekshiramiz
|
| 21 |
-
if not os.path.exists(DATA_PATH) or not os.listdir(DATA_PATH):
|
| 22 |
-
|
| 23 |
-
else:
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
# 2. Bazani tekshirish va yaratish (CHROMA emas, VECTOR_DB)
|
| 27 |
-
if not os.path.exists(DB_PATH):
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
else:
|
| 37 |
-
|
| 38 |
-
|
| 39 |
|
| 40 |
st.title("π€ TechFlow Support Agent")
|
| 41 |
|
|
|
|
| 15 |
DB_PATH = os.path.join(BASE_DIR, "vector_db") # Ingest.py dagi bilan bir xil bo'lishi shart
|
| 16 |
DATA_PATH = os.path.join(BASE_DIR, "data")
|
| 17 |
|
| 18 |
+
# st.sidebar.write("### Tizim holati:")
|
| 19 |
+
|
| 20 |
+
# # 1. Avval 'data' papkasida PDF-lar borligini tekshiramiz
|
| 21 |
+
# if not os.path.exists(DATA_PATH) or not os.listdir(DATA_PATH):
|
| 22 |
+
# st.sidebar.error("β 'data/' papkasida PDF fayllar topilmadi!")
|
| 23 |
+
# else:
|
| 24 |
+
# st.sidebar.success(f"π {len(os.listdir(DATA_PATH))} ta PDF fayl topildi.")
|
| 25 |
+
|
| 26 |
+
# # 2. Bazani tekshirish va yaratish (CHROMA emas, VECTOR_DB)
|
| 27 |
+
# if not os.path.exists(DB_PATH):
|
| 28 |
+
# st.sidebar.warning("β οΈ Baza topilmadi. Ingest boshlanmoqda...")
|
| 29 |
+
# with st.spinner("Bilimlar bazasi yaratilmoqda..."):
|
| 30 |
+
# try:
|
| 31 |
+
# run_ingestion()
|
| 32 |
+
# st.success("β
Ingestion yakunlandi!")
|
| 33 |
+
# st.rerun() # Bazani ko'rishi uchun refresh
|
| 34 |
+
# except Exception as e:
|
| 35 |
+
# st.error(f"β Ingestion xatosi: {e}")
|
| 36 |
+
# else:
|
| 37 |
+
# st.sidebar.success(f"β
Baza tayyor: {DB_PATH}")
|
| 38 |
+
# st.sidebar.write("Fayllar:", os.listdir(DB_PATH))
|
| 39 |
|
| 40 |
st.title("π€ TechFlow Support Agent")
|
| 41 |
|