Yoxas commited on
Commit
17a0d8a
·
verified ·
1 Parent(s): d7bf8ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -29,8 +29,12 @@ if len(embeddings_array.shape) == 1:
29
 
30
  # Create a new Dataset with the modified data
31
  new_data = data.remove_columns("Abstract_Embeddings")
 
32
  new_data = new_data.add_column("Abstract_Embeddings", embeddings_array.tolist())
33
 
 
 
 
34
  new_data = new_data.add_faiss_index("Abstract_Embeddings")
35
 
36
 
 
29
 
30
  # Create a new Dataset with the modified data
31
  new_data = data.remove_columns("Abstract_Embeddings")
32
+ embeddings_array = np.array(data["Abstract_Embeddings"])
33
  new_data = new_data.add_column("Abstract_Embeddings", embeddings_array.tolist())
34
 
35
+ # Convert the column to a numpy array
36
+ new_data.set_format("numpy", columns=["Abstract_Embeddings"])
37
+
38
  new_data = new_data.add_faiss_index("Abstract_Embeddings")
39
 
40