Spaces:
Running
Running
Download frontends/react/src/algorithms.ts from nhamid289/optimization-dev: direct link, hf CLI and curl.
- Browser
- Download file 447 Bytes
-
https://huggingface.co/spaces/nhamid289/optimization-dev/resolve/main/frontends/react/src/algorithms.ts
- Command line
-
hf download hf://spaces/nhamid289/optimization-dev/frontends/react/src/algorithms.ts
-
curl -L -o algorithms.ts https://huggingface.co/spaces/nhamid289/optimization-dev/resolve/main/frontends/react/src/algorithms.ts
447 Bytes
| import type { ModelSpec } from "@elvis/ui"; | |
| import spec from "../../../backend/src/algorithms.json"; | |
| // The optimisers, from the spec shared with the Python backend. JSON imports | |
| // type "kind" as string, so the shape is checked by backend/tests instead. | |
| export const ALGORITHMS = spec.algorithms as unknown as ModelSpec[]; | |
| export function algorithmById(id: string): ModelSpec { | |
| return ALGORITHMS.find((a) => a.id === id) ?? ALGORITHMS[0]; | |
| } | |