Update app.py
Browse files
app.py
CHANGED
@@ -122,7 +122,7 @@ def load_hnsw_index(index_file):
|
|
122 |
def create_hnsw_index(embeddings_file, M=16, efC=100):
|
123 |
embeddings = np.load(embeddings_file)
|
124 |
num_dim = embeddings.shape[1]
|
125 |
-
ids = np.arange(embeddings.shape[0]
|
126 |
index = hnswlib.Index(space="ip", dim=num_dim)
|
127 |
index.init_index(max_elements=embeddings.shape[0], ef_construction=efC, M=M)
|
128 |
index.add_items(embeddings, ids)
|
|
|
122 |
def create_hnsw_index(embeddings_file, M=16, efC=100):
|
123 |
embeddings = np.load(embeddings_file)
|
124 |
num_dim = embeddings.shape[1]
|
125 |
+
ids = np.arange(embeddings.shape[0])
|
126 |
index = hnswlib.Index(space="ip", dim=num_dim)
|
127 |
index.init_index(max_elements=embeddings.shape[0], ef_construction=efC, M=M)
|
128 |
index.add_items(embeddings, ids)
|