Yoxas commited on
Commit
05284ce
·
verified ·
1 Parent(s): 7db0360

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -17,12 +17,18 @@ dataset = load_dataset("Yoxas/statistical_literacyv2")
17
 
18
  data = dataset["train"]
19
 
 
 
 
20
  # Check the shape of the embeddings
21
- print(data["Abstract_Embeddings"].shape)
22
 
23
  # Reshape the embeddings if necessary
24
- if len(data["Abstract_Embeddings"].shape) == 1:
25
- data["Abstract_Embeddings"] = data["Abstract_Embeddings"].reshape(-1, 1)
 
 
 
26
 
27
  data = data.add_faiss_index("Abstract_Embeddings")
28
 
 
17
 
18
  data = dataset["train"]
19
 
20
+ # Convert the list to a numpy array
21
+ embeddings_array = np.array(data["Abstract_Embeddings"])
22
+
23
  # Check the shape of the embeddings
24
+ print(embeddings_array.shape)
25
 
26
  # Reshape the embeddings if necessary
27
+ if len(embeddings_array.shape) == 1:
28
+ embeddings_array = embeddings_array.reshape(-1, 1)
29
+
30
+ # Replace the list with the numpy array
31
+ data["Abstract_Embeddings"] = embeddings_array
32
 
33
  data = data.add_faiss_index("Abstract_Embeddings")
34