Download src/shared/model-param-b.ts from shimen/shinclaw: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/shared/model-param-b.ts
- Command line
-
hf download hf://spaces/shimen/shinclaw/src/shared/model-param-b.ts
-
curl -L -o model-param-b.ts https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/shared/model-param-b.ts
524 Bytes
| export function inferParamBFromIdOrName(text: string): number | null { | |
| const raw = text.toLowerCase(); | |
| const matches = raw.matchAll(/(?:^|[^a-z0-9])[a-z]?(\d+(?:\.\d+)?)b(?:[^a-z0-9]|$)/g); | |
| let best: number | null = null; | |
| for (const match of matches) { | |
| const numRaw = match[1]; | |
| if (!numRaw) { | |
| continue; | |
| } | |
| const value = Number(numRaw); | |
| if (!Number.isFinite(value) || value <= 0) { | |
| continue; | |
| } | |
| if (best === null || value > best) { | |
| best = value; | |
| } | |
| } | |
| return best; | |
| } | |