Spaces:
Running
Running
Download frontends/react/src/python.ts from nhamid289/decision_boundary-dev: direct link, hf CLI and curl.
- Browser
- Download file 989 Bytes
-
https://huggingface.co/spaces/nhamid289/decision_boundary-dev/resolve/main/frontends/react/src/python.ts
- Command line
-
hf download hf://spaces/nhamid289/decision_boundary-dev/frontends/react/src/python.ts
-
curl -L -o python.ts https://huggingface.co/spaces/nhamid289/decision_boundary-dev/resolve/main/frontends/react/src/python.ts
989 Bytes
| import { createPython } from "@elvis/pyodide"; | |
| import type { ModelResults, Projection } from "@elvis/ui"; | |
| import type { DecisionBoundaryResult, DecisionBoundarySettings, ModelSettings } from "./types"; | |
| // The methods of backend/src/manager.py's Manager | |
| export type DecisionBoundaryApi = { | |
| // projection maps plot coordinates back to inputs; omitted when the inputs are the plot coordinates | |
| handle_set_dataset: { args: { inputs: number[][]; outputs: string[]; input_names?: string[]; projection?: Projection }; result: null }; | |
| handle_set_model_config: { args: ModelSettings; result: null }; | |
| // Metrics and learned parameters; null when there is no data to fit | |
| handle_build_model: { args: undefined; result: ModelResults | null }; | |
| handle_get_decision_boundary: { args: DecisionBoundarySettings; result: DecisionBoundaryResult }; | |
| }; | |
| export const python = createPython<DecisionBoundaryApi>( | |
| new Worker(new URL("./pyodide.worker.ts", import.meta.url), { type: "module" }), | |
| ); | |