Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,12 +7,13 @@ import pynndescent
|
|
7 |
import numpy as np
|
8 |
|
9 |
# Only runs once when the script is first run.
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
embs= np.load('slugs_embeddings_1024k.npy', 'r')
|
14 |
index = pynndescent.NNDescent(embs, metric="cosine")
|
15 |
index.prepare()
|
|
|
16 |
|
17 |
# Load model for computing embeddings.
|
18 |
feature_extractor = AutoFeatureExtractor.from_pretrained("sasha/autotrain-sea-slug-similarity-2498977005")
|
|
|
7 |
import numpy as np
|
8 |
|
9 |
# Only runs once when the script is first run.
|
10 |
+
with open("slugs_1024_new.pickle", "rb") as handle:
|
11 |
+
index = pickle.load(handle)
|
12 |
+
'''
|
13 |
embs= np.load('slugs_embeddings_1024k.npy', 'r')
|
14 |
index = pynndescent.NNDescent(embs, metric="cosine")
|
15 |
index.prepare()
|
16 |
+
'''
|
17 |
|
18 |
# Load model for computing embeddings.
|
19 |
feature_extractor = AutoFeatureExtractor.from_pretrained("sasha/autotrain-sea-slug-similarity-2498977005")
|