Download local-docker/packages/runtime/src/protocol.ts from ti3x-m/web-decisions-webgpu-quickstart: direct link, hf CLI and curl.
- Browser
- Download file 967 Bytes
-
https://huggingface.co/spaces/ti3x-m/web-decisions-webgpu-quickstart/resolve/main/local-docker/packages/runtime/src/protocol.ts
- Command line
-
hf download hf://spaces/ti3x-m/web-decisions-webgpu-quickstart/local-docker/packages/runtime/src/protocol.ts
-
curl -L -o protocol.ts https://huggingface.co/spaces/ti3x-m/web-decisions-webgpu-quickstart/resolve/main/local-docker/packages/runtime/src/protocol.ts
967 Bytes
| import type { ExecutionBackend, LayaQuestion, LoadProgress, ModelId, Precision, SystemOneResult } from "./shared/types"; | |
| export type WorkerRequest = | |
| | { id: number; type: "ping" } | |
| | { id: number; type: "load"; model: ModelId; manifestUrl: string; precision: Precision; backend: ExecutionBackend } | |
| | { id: number; type: "infer"; state: unknown; questions: Array<{ id: string; question: LayaQuestion }> } | |
| | { id: number; type: "close" }; | |
| export type WorkerRequestWithoutId = WorkerRequest extends infer Request | |
| ? Request extends { id: number } | |
| ? Omit<Request, "id"> | |
| : never | |
| : never; | |
| export type WorkerResponse = | |
| | { id: number; type: "ready" } | |
| | { id: number; type: "progress"; progress: LoadProgress } | |
| | { id: number; type: "loaded" } | |
| | { id: number; type: "result"; result: SystemOneResult } | |
| | { id: number; type: "closed" } | |
| | { id: number; type: "error"; code: "LOAD_FAILED" | "INFERENCE_FAILED"; stage: string; message: string }; | |