Instructions to use Wellz1000/hermes-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- HERMES
How to use Wellz1000/hermes-2 with HERMES:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download apps/desktop/src/lib/format.ts from Wellz1000/hermes-2: direct link, hf CLI and curl.
- Browser
- Download file 831 Bytes
-
https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/src/lib/format.ts
- Command line
-
hf download hf://Wellz1000/hermes-2/apps/desktop/src/lib/format.ts
-
curl -L -o format.ts https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/src/lib/format.ts
831 Bytes
| // THE compact-number formatter — every user-facing count/token figure goes | |
| // through here. 999 → "999", 1000 → "1k", 1230 → "1.2k", 10000 → "10k", | |
| // 1_500_000 → "1.5M". Do not hand-roll `/ 1000` display math elsewhere. | |
| export function compactNumber(value: null | number | undefined): string { | |
| const num = Number(value ?? 0) | |
| if (!Number.isFinite(num) || num <= 0) { | |
| return '0' | |
| } | |
| const scaled = (v: number, suffix: string) => `${v.toFixed(1).replace(/\.0$/, '')}${suffix}` | |
| // Thresholds sit just under the unit boundary so rounding can't produce | |
| // "1000k" or "1000" — those promote to the next unit instead. | |
| if (num >= 999_950) { | |
| return scaled(num / 1_000_000, 'M') | |
| } | |
| if (num >= 999.5) { | |
| return scaled(num / 1_000, 'k') | |
| } | |
| return `${Math.round(num)}` | |
| } | |