Spaces:
Running
Running
thenativefox
commited on
Commit
·
1c860fb
1
Parent(s):
bd075c2
attampt5
Browse files- backend/semantic_search.py +13 -2
backend/semantic_search.py
CHANGED
@@ -13,9 +13,8 @@ logger = logging.getLogger(__name__)
|
|
13 |
# Load environment variables from the .env file
|
14 |
load_dotenv()
|
15 |
|
16 |
-
# Connect to the LanceDB database
|
17 |
-
current_working_dir = Path(os.getcwd())
|
18 |
# Determine the LanceDB path and log it
|
|
|
19 |
db_path = current_working_dir / ".lancedb"
|
20 |
logger.info(f"Database path: {db_path}")
|
21 |
|
@@ -25,8 +24,20 @@ if db_path.exists():
|
|
25 |
logger.info(f"Contents of the LanceDB directory: {lancedb_contents}")
|
26 |
else:
|
27 |
logger.error(f"LanceDB directory does not exist at path: {db_path}")
|
|
|
28 |
db = lancedb.connect(db_path)
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
MODEL1_STRATEGY1 = "model1_fixed"
|
31 |
MODEL2_STRATEGY1 = "model2_fixed"
|
32 |
MODEL3_STRATEGY1 = "model3_fixed"
|
|
|
13 |
# Load environment variables from the .env file
|
14 |
load_dotenv()
|
15 |
|
|
|
|
|
16 |
# Determine the LanceDB path and log it
|
17 |
+
current_working_dir = Path(os.getcwd())
|
18 |
db_path = current_working_dir / ".lancedb"
|
19 |
logger.info(f"Database path: {db_path}")
|
20 |
|
|
|
24 |
logger.info(f"Contents of the LanceDB directory: {lancedb_contents}")
|
25 |
else:
|
26 |
logger.error(f"LanceDB directory does not exist at path: {db_path}")
|
27 |
+
|
28 |
db = lancedb.connect(db_path)
|
29 |
|
30 |
+
# List and log all tables in the database
|
31 |
+
table_names = db.table_names()
|
32 |
+
logger.info(f"Available LanceDB Tables: {table_names}")
|
33 |
+
|
34 |
+
model1_fixed_path = db_path / "model1_fixed.lance"
|
35 |
+
if model1_fixed_path.exists():
|
36 |
+
model1_fixed_contents = os.listdir(model1_fixed_path)
|
37 |
+
logger.info(f"Contents of the model1_fixed.lance folder: {model1_fixed_contents}")
|
38 |
+
else:
|
39 |
+
logger.error(f"model1_fixed.lance directory does not exist at path: {model1_fixed_path}")
|
40 |
+
|
41 |
MODEL1_STRATEGY1 = "model1_fixed"
|
42 |
MODEL2_STRATEGY1 = "model2_fixed"
|
43 |
MODEL3_STRATEGY1 = "model3_fixed"
|