Yoxas commited on
Commit
21336c5
·
verified ·
1 Parent(s): b71f887

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -41,6 +41,7 @@ else:
41
 
42
  # Ensure embeddings are stacked as float32
43
  embeddings = np.vstack(data['embedding'].values).astype(np.float32)
 
44
  gpu_index.add(embeddings)
45
 
46
  # Check if GPU is available
@@ -81,6 +82,7 @@ def retrieve_and_generate(question):
81
 
82
  # Search in FAISS index
83
  try:
 
84
  _, indices = gpu_index.search(question_embedding, k=1)
85
  if indices.size == 0:
86
  logging.error("No results found in FAISS search.")
 
41
 
42
  # Ensure embeddings are stacked as float32
43
  embeddings = np.vstack(data['embedding'].values).astype(np.float32)
44
+ logging.debug(f"Embeddings shape: {embeddings.shape}, dtype: {embeddings.dtype}")
45
  gpu_index.add(embeddings)
46
 
47
  # Check if GPU is available
 
82
 
83
  # Search in FAISS index
84
  try:
85
+ logging.debug(f"Searching FAISS index with question embedding: {question_embedding}")
86
  _, indices = gpu_index.search(question_embedding, k=1)
87
  if indices.size == 0:
88
  logging.error("No results found in FAISS search.")