Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,13 +23,10 @@ embeddings_array = np.array(data["Abstract_Embeddings"])
|
|
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 |
-
# Create a new Dataset with the modified data
|
31 |
new_data = data.remove_columns("Abstract_Embeddings")
|
32 |
embeddings_array = np.array(data["Abstract_Embeddings"])
|
|
|
|
|
33 |
new_data = new_data.add_column("Abstract_Embeddings", embeddings_array.tolist())
|
34 |
|
35 |
# Convert the column to a numpy array
|
|
|
23 |
# Check the shape of the embeddings
|
24 |
print(embeddings_array.shape)
|
25 |
|
|
|
|
|
|
|
|
|
|
|
26 |
new_data = data.remove_columns("Abstract_Embeddings")
|
27 |
embeddings_array = np.array(data["Abstract_Embeddings"])
|
28 |
+
if len(embeddings_array.shape) == 1:
|
29 |
+
embeddings_array = embeddings_array.reshape(-1, 1)
|
30 |
new_data = new_data.add_column("Abstract_Embeddings", embeddings_array.tolist())
|
31 |
|
32 |
# Convert the column to a numpy array
|