rajat5ranjan commited on
Commit
6f73f4e
·
verified ·
1 Parent(s): ab5abc8

Update stock_vector_db.py

Browse files
Files changed (1) hide show
  1. stock_vector_db.py +6 -1
stock_vector_db.py CHANGED
@@ -29,7 +29,7 @@ class HFVectorDB:
29
 
30
  shutil.copy(faiss_path, os.path.join(self.local_index_dir, "index.faiss"))
31
  shutil.copy(pkl_path, os.path.join(self.local_index_dir, "index.pkl"))
32
- st.write("✅ Downloaded FAISS index files from HF repo using HfApi")
33
  except Exception as e:
34
  st.write(f"⚠️ Could not download FAISS index files: {e}")
35
 
@@ -41,6 +41,11 @@ class HFVectorDB:
41
  self.index = None
42
  return
43
 
 
 
 
 
 
44
  self.index = FAISS.load_local(self.local_index_dir, self.embedding_model)
45
  st.write("✅ Loaded FAISS index from local")
46
  except Exception:
 
29
 
30
  shutil.copy(faiss_path, os.path.join(self.local_index_dir, "index.faiss"))
31
  shutil.copy(pkl_path, os.path.join(self.local_index_dir, "index.pkl"))
32
+ st.write(f"✅ Downloaded FAISS index files from HF repo using HfApi to {self.local_index_dir}")
33
  except Exception as e:
34
  st.write(f"⚠️ Could not download FAISS index files: {e}")
35
 
 
41
  self.index = None
42
  return
43
 
44
+ # Add more detailed logging before the load attempt
45
+ st.write(f"Attempting to load FAISS index from: {self.local_index_dir}")
46
+ st.write(f"Contents of local_index_dir: {os.listdir(self.local_index_dir)}")
47
+
48
+
49
  self.index = FAISS.load_local(self.local_index_dir, self.embedding_model)
50
  st.write("✅ Loaded FAISS index from local")
51
  except Exception: