Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
|
@@ -499,9 +499,14 @@ def create_embedding_visualization(df: pd.DataFrame, color_by: str = 'is_positiv
|
|
| 499 |
|
| 500 |
for idx, row in df.iterrows():
|
| 501 |
emb = row.get(embedding_col, [])
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 505 |
|
| 506 |
if len(embeddings) < 3:
|
| 507 |
fig = go.Figure()
|
|
|
|
| 499 |
|
| 500 |
for idx, row in df.iterrows():
|
| 501 |
emb = row.get(embedding_col, [])
|
| 502 |
+
# Handle both list and numpy array formats
|
| 503 |
+
if emb is not None:
|
| 504 |
+
if isinstance(emb, np.ndarray) and len(emb) > 0:
|
| 505 |
+
embeddings.append(emb.tolist())
|
| 506 |
+
valid_indices.append(idx)
|
| 507 |
+
elif isinstance(emb, list) and len(emb) > 0:
|
| 508 |
+
embeddings.append(emb)
|
| 509 |
+
valid_indices.append(idx)
|
| 510 |
|
| 511 |
if len(embeddings) < 3:
|
| 512 |
fig = go.Figure()
|