Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -102,6 +102,8 @@ def plot_tsne(tech_filter, snr_filter, mod_filter, mob_filter, representation, c
|
|
| 102 |
try:
|
| 103 |
tsne = TSNE(**tsne_kwargs)
|
| 104 |
projections = tsne.fit_transform(features)
|
|
|
|
|
|
|
| 105 |
status_msg = f"t-SNE ok ({len(filtered_df)} samples)."
|
| 106 |
except Exception as e:
|
| 107 |
# Fallback to 2D PCA so we always show something
|
|
@@ -143,7 +145,7 @@ def quick_modulation_plot():
|
|
| 143 |
mob_filter=None,
|
| 144 |
representation="LWM Embedding",
|
| 145 |
color_by="mod",
|
| 146 |
-
perplexity=
|
| 147 |
n_iter=750,
|
| 148 |
)
|
| 149 |
|
|
|
|
| 102 |
try:
|
| 103 |
tsne = TSNE(**tsne_kwargs)
|
| 104 |
projections = tsne.fit_transform(features)
|
| 105 |
+
if not np.isfinite(projections).all():
|
| 106 |
+
raise ValueError("t-SNE produced NaN/Inf projections")
|
| 107 |
status_msg = f"t-SNE ok ({len(filtered_df)} samples)."
|
| 108 |
except Exception as e:
|
| 109 |
# Fallback to 2D PCA so we always show something
|
|
|
|
| 145 |
mob_filter=None,
|
| 146 |
representation="LWM Embedding",
|
| 147 |
color_by="mod",
|
| 148 |
+
perplexity=5,
|
| 149 |
n_iter=750,
|
| 150 |
)
|
| 151 |
|