Yoxas commited on
Commit
4ffc765
·
verified ·
1 Parent(s): 11d5743

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -15,8 +15,6 @@ ST = SentenceTransformer("mixedbread-ai/mxbai-embed-large-v1")
15
 
16
  dataset = load_dataset("Yoxas/statistical_literacyv2")
17
 
18
- data = dataset["train"]
19
-
20
  # Convert the list to a numpy array
21
  embeddings_array = np.array(data["Abstract_Embeddings"])
22
 
@@ -34,8 +32,11 @@ new_data = new_data.add_column("Abstract_Embeddings", embeddings_array.tolist())
34
  # Convert the column to a numpy array
35
  new_data.set_format("numpy", columns=["Abstract_Embeddings"])
36
 
37
- new_data = new_data.add_faiss_index("Abstract_Embeddings")
 
38
 
 
 
39
 
40
  model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
41
 
 
15
 
16
  dataset = load_dataset("Yoxas/statistical_literacyv2")
17
 
 
 
18
  # Convert the list to a numpy array
19
  embeddings_array = np.array(data["Abstract_Embeddings"])
20
 
 
32
  # Convert the column to a numpy array
33
  new_data.set_format("numpy", columns=["Abstract_Embeddings"])
34
 
35
+ # Initialize the Faiss index
36
+ new_data.add_faiss_index("Abstract_Embeddings")
37
 
38
+ # Now you can use the Dataset with the Faiss index
39
+ data = dataset["train"]
40
 
41
  model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
42