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 web/src/lib/format.ts from Wellz1000/hermes-2: direct link, hf CLI and curl.
- Browser
- Download file 382 Bytes
-
https://huggingface.co/Wellz1000/hermes-2/resolve/main/web/src/lib/format.ts
- Command line
-
hf download hf://Wellz1000/hermes-2/web/src/lib/format.ts
-
curl -L -o format.ts https://huggingface.co/Wellz1000/hermes-2/resolve/main/web/src/lib/format.ts
382 Bytes
| /** | |
| * Format a token count as a human-readable string (e.g. 1M, 128K, 4096). | |
| * Strips trailing ".0" for clean round numbers. | |
| */ | |
| export function formatTokenCount(n: number): string { | |
| if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(n % 1_000_000 === 0 ? 0 : 1)}M`; | |
| if (n >= 1_000) return `${(n / 1_000).toFixed(n % 1_000 === 0 ? 0 : 1)}K`; | |
| return String(n); | |
| } | |