codelion commited on
Commit
9672d7f
·
verified ·
1 Parent(s): e6325c2

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
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
- if isinstance(emb, list) and len(emb) > 0:
503
- embeddings.append(emb)
504
- valid_indices.append(idx)
 
 
 
 
 
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()