somewheresy commited on
Commit
7ef10db
1 Parent(s): c4805d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -485,6 +485,7 @@ def main():
485
  print("Model initialized.")
486
 
487
  query_embedding = model.encode([query])
 
488
  # Retrieve examples by title similarity (or abstract, depending on your preference)
489
  scores_title, retrieved_examples_title = st.session_state.dataclysm_title_indexed.get_nearest_examples('title_embedding', query_embedding, k=top_k)
490
  df_query = pd.DataFrame(retrieved_examples_title)
 
485
  print("Model initialized.")
486
 
487
  query_embedding = model.encode([query])
488
+ query_embedding = np.array(query_embedding).reshape(1, -1).astype('float32')
489
  # Retrieve examples by title similarity (or abstract, depending on your preference)
490
  scores_title, retrieved_examples_title = st.session_state.dataclysm_title_indexed.get_nearest_examples('title_embedding', query_embedding, k=top_k)
491
  df_query = pd.DataFrame(retrieved_examples_title)