Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,9 +18,9 @@ data = dataset["train"]
|
|
18 |
|
19 |
# Convert the string embeddings to numerical arrays
|
20 |
def convert_and_ensure_2d_embeddings(example):
|
21 |
-
#
|
22 |
embedding_str = example['embedding']
|
23 |
-
embedding_str = embedding_str.replace('\n', ' ')
|
24 |
embedding_list = list(map(float, embedding_str.strip("[]").split()))
|
25 |
embeddings = np.array(embedding_list, dtype=np.float32)
|
26 |
# Ensure the embeddings are 2-dimensional
|
|
|
18 |
|
19 |
# Convert the string embeddings to numerical arrays
|
20 |
def convert_and_ensure_2d_embeddings(example):
|
21 |
+
# Clean the embedding string
|
22 |
embedding_str = example['embedding']
|
23 |
+
embedding_str = embedding_str.replace('\n', ' ').replace('...', '')
|
24 |
embedding_list = list(map(float, embedding_str.strip("[]").split()))
|
25 |
embeddings = np.array(embedding_list, dtype=np.float32)
|
26 |
# Ensure the embeddings are 2-dimensional
|