Spaces:
Running
Running
Download src/lib/eloInterval.ts from TabBioMed/leaderboard: direct link, hf CLI and curl.
- Browser
- Download file 479 Bytes
-
https://huggingface.co/spaces/TabBioMed/leaderboard/resolve/main/src/lib/eloInterval.ts
- Command line
-
hf download hf://spaces/TabBioMed/leaderboard/src/lib/eloInterval.ts
-
curl -L -o eloInterval.ts https://huggingface.co/spaces/TabBioMed/leaderboard/resolve/main/src/lib/eloInterval.ts
479 Bytes
| import type { LeaderboardEntry } from '../types/benchmark'; | |
| export function hasEloInterval( | |
| entry: LeaderboardEntry, | |
| ): entry is LeaderboardEntry & { eloLo: number; eloHi: number } { | |
| return entry.eloLo !== null && entry.eloHi !== null && entry.eloHi > entry.eloLo; | |
| } | |
| export function formatEloInterval(entry: LeaderboardEntry, digits = 0): string | null { | |
| return hasEloInterval(entry) | |
| ? `[${entry.eloLo.toFixed(digits)}, ${entry.eloHi.toFixed(digits)}]` | |
| : null; | |
| } | |