Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -483,7 +483,7 @@ def _saliency_figure(sal, p_mean, net_names=None, net_bounds=None, net_colors=No
|
|
| 483 |
ex = 68 * np.outer(np.cos(u), np.sin(v))
|
| 484 |
ey = 85 * np.outer(np.sin(u), np.sin(v)) - 10
|
| 485 |
ez = 60 * np.outer(np.ones_like(u), np.cos(v)) + 28
|
| 486 |
-
ax3.plot_wireframe(ex, ey, ez, color="#
|
| 487 |
|
| 488 |
# Network nodes — size proportional to importance
|
| 489 |
imp_norm = (net_imp - net_imp.min()) / (net_imp.max() - net_imp.min() + 1e-9)
|
|
@@ -761,7 +761,14 @@ CC200 LOSO AUC = 0.7298 · HO = 0.7212 · AAL = 0.6959 · 1,102 subjects · 20 s
|
|
| 761 |
llm_text = _llm_report(p_mean, per_model, net_saliency=net_saliency)
|
| 762 |
if llm_text.startswith("[LLM unavailable") and _demo_key in _DEMO_LLM_CACHE:
|
| 763 |
llm_text = _DEMO_LLM_CACHE[_demo_key]
|
| 764 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 765 |
report = f"""
|
| 766 |
<div style="background:#0f1a1a;border:1px solid #1a3a3a;border-radius:8px;padding:18px 24px;margin-top:12px">
|
| 767 |
<div style="display:flex;align-items:center;gap:10px;margin-bottom:10px">
|
|
|
|
| 483 |
ex = 68 * np.outer(np.cos(u), np.sin(v))
|
| 484 |
ey = 85 * np.outer(np.sin(u), np.sin(v)) - 10
|
| 485 |
ez = 60 * np.outer(np.ones_like(u), np.cos(v)) + 28
|
| 486 |
+
ax3.plot_wireframe(ex, ey, ez, color="#4a5568", linewidth=0.5, alpha=0.7, zorder=0)
|
| 487 |
|
| 488 |
# Network nodes — size proportional to importance
|
| 489 |
imp_norm = (net_imp - net_imp.min()) / (net_imp.max() - net_imp.min() + 1e-9)
|
|
|
|
| 761 |
llm_text = _llm_report(p_mean, per_model, net_saliency=net_saliency)
|
| 762 |
if llm_text.startswith("[LLM unavailable") and _demo_key in _DEMO_LLM_CACHE:
|
| 763 |
llm_text = _DEMO_LLM_CACHE[_demo_key]
|
| 764 |
+
import re as _re
|
| 765 |
+
def _md_to_html(txt):
|
| 766 |
+
txt = _re.sub(r'^#{1,3}\s*(.+)$', r'<h4 style="color:#94a3b8;margin:1em 0 0.3em;font-size:0.9rem">\1</h4>', txt, flags=_re.MULTILINE)
|
| 767 |
+
txt = _re.sub(r'\*\*(.+?)\*\*', r'<strong style="color:#e2e8f0">\1</strong>', txt)
|
| 768 |
+
txt = _re.sub(r'\*(.+?)\*', r'<em>\1</em>', txt)
|
| 769 |
+
txt = _re.sub(r'\n', '<br>', txt)
|
| 770 |
+
return txt
|
| 771 |
+
llm_block = f'<div style="color:#cbd5e1;font-size:0.85rem;line-height:1.7">{_md_to_html(llm_text)}</div>'
|
| 772 |
report = f"""
|
| 773 |
<div style="background:#0f1a1a;border:1px solid #1a3a3a;border-radius:8px;padding:18px 24px;margin-top:12px">
|
| 774 |
<div style="display:flex;align-items:center;gap:10px;margin-bottom:10px">
|