maxidl commited on
Commit
6d2d69f
·
verified ·
1 Parent(s): 52ee06a

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +43 -7
index.html CHANGED
@@ -455,7 +455,7 @@
455
  <body>
456
  <div class="page-header">
457
  <h1>ellamind base-eval</h1>
458
- <p style="margin:4px 0 0;font-size:13px;color:#6c757d;"><a href="https://github.com/ellamind/base-eval" target="_blank" rel="noopener" style="color:#4361ee;">ellamind/base-eval</a> · Data: <a href="https://huggingface.co/datasets/ellamind/eval-scores-ref" target="_blank" rel="noopener" style="color:#4361ee;">ellamind/eval-scores-ref</a></p>
459
  </div>
460
 
461
  <div id="init-loading">Initializing DuckDB...</div>
@@ -1097,7 +1097,13 @@
1097
  const cb = document.createElement('input');
1098
  cb.type = 'checkbox';
1099
  cb.value = m.model_display_name;
1100
- cb.checked = m.is_checkpoint || (!m.is_checkpoint && /^Qwen3\b(?!\.5)/.test(m.model_display_name));
 
 
 
 
 
 
1101
  cb.dataset.isCheckpoint = m.is_checkpoint;
1102
  cb.addEventListener('change', () => this.renderChart());
1103
 
@@ -2003,6 +2009,32 @@
2003
  }
2004
  }
2005
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2006
  async function initHfAuth() {
2007
  // Try restoring from localStorage
2008
  let oauthResult = null;
@@ -2014,9 +2046,17 @@
2014
  // Handle OAuth redirect (takes priority over stored)
2015
  oauthResult = (await oauthHandleRedirectIfPresent()) || oauthResult;
2016
 
 
 
 
 
 
 
 
2017
  if (oauthResult?.accessToken) {
2018
  hfAccessToken = oauthResult.accessToken;
2019
  localStorage.setItem('hf_oauth', JSON.stringify(oauthResult));
 
2020
  }
2021
 
2022
  updateAuthUI(oauthResult);
@@ -2031,11 +2071,7 @@
2031
  });
2032
 
2033
  // Sign out
2034
- document.getElementById('hf-signout-btn').addEventListener('click', () => {
2035
- localStorage.removeItem('hf_oauth');
2036
- hfAccessToken = null;
2037
- updateAuthUI(null);
2038
- });
2039
  }
2040
 
2041
  // ── Init ────────────────────────────────────────────────────
 
455
  <body>
456
  <div class="page-header">
457
  <h1>ellamind base-eval</h1>
458
+ <p style="margin:4px 0 0;font-size:13px;color:#6c757d;">Benchmarks: <a href="https://github.com/ellamind/base-eval" target="_blank" rel="noopener" style="color:#4361ee;">ellamind/base-eval</a> · Data: <a href="https://huggingface.co/datasets/ellamind/eval-scores-ref" target="_blank" rel="noopener" style="color:#4361ee;">ellamind/eval-scores-ref</a></p>
459
  </div>
460
 
461
  <div id="init-loading">Initializing DuckDB...</div>
 
1097
  const cb = document.createElement('input');
1098
  cb.type = 'checkbox';
1099
  cb.value = m.model_display_name;
1100
+ const DEFAULT_MODELS = [
1101
+ 'SmolLM3 3B', 'Olmo 3 7B', 'Olmo 3 32B',
1102
+ 'Apertus 8B', 'Apertus 70B', 'Kimi K2',
1103
+ 'Nemotron 3 Nano 30B-A3B', 'Nemotron 3 Super 120B-A12B',
1104
+ ];
1105
+ cb.checked = DEFAULT_MODELS.includes(m.model_display_name)
1106
+ || /^Qwen3\.5\b/.test(m.model_display_name);
1107
  cb.dataset.isCheckpoint = m.is_checkpoint;
1108
  cb.addEventListener('change', () => this.renderChart());
1109
 
 
2009
  }
2010
  }
2011
 
2012
+ let _hfExpiryTimer = null;
2013
+
2014
+ function hfSignOut() {
2015
+ localStorage.removeItem('hf_oauth');
2016
+ hfAccessToken = null;
2017
+ if (_hfExpiryTimer) { clearTimeout(_hfExpiryTimer); _hfExpiryTimer = null; }
2018
+ updateAuthUI(null);
2019
+ }
2020
+
2021
+ function isHfTokenExpired(oauthResult) {
2022
+ if (!oauthResult?.accessTokenExpiresAt) return false;
2023
+ // Treat as expired 60s early to avoid edge-case 401s
2024
+ return new Date(oauthResult.accessTokenExpiresAt).getTime() - 60_000 < Date.now();
2025
+ }
2026
+
2027
+ function scheduleHfExpiry(oauthResult) {
2028
+ if (_hfExpiryTimer) clearTimeout(_hfExpiryTimer);
2029
+ if (!oauthResult?.accessTokenExpiresAt) return;
2030
+ const ms = new Date(oauthResult.accessTokenExpiresAt).getTime() - 60_000 - Date.now();
2031
+ if (ms <= 0) return;
2032
+ _hfExpiryTimer = setTimeout(() => {
2033
+ console.warn('HF OAuth token expired, signing out automatically.');
2034
+ hfSignOut();
2035
+ }, ms);
2036
+ }
2037
+
2038
  async function initHfAuth() {
2039
  // Try restoring from localStorage
2040
  let oauthResult = null;
 
2046
  // Handle OAuth redirect (takes priority over stored)
2047
  oauthResult = (await oauthHandleRedirectIfPresent()) || oauthResult;
2048
 
2049
+ // Discard expired tokens instead of using them and getting 401s
2050
+ if (oauthResult && isHfTokenExpired(oauthResult)) {
2051
+ console.warn('HF OAuth token expired, discarding.');
2052
+ oauthResult = null;
2053
+ localStorage.removeItem('hf_oauth');
2054
+ }
2055
+
2056
  if (oauthResult?.accessToken) {
2057
  hfAccessToken = oauthResult.accessToken;
2058
  localStorage.setItem('hf_oauth', JSON.stringify(oauthResult));
2059
+ scheduleHfExpiry(oauthResult);
2060
  }
2061
 
2062
  updateAuthUI(oauthResult);
 
2071
  });
2072
 
2073
  // Sign out
2074
+ document.getElementById('hf-signout-btn').addEventListener('click', () => hfSignOut());
 
 
 
 
2075
  }
2076
 
2077
  // ── Init ────────────────────────────────────────────────────