Download lib/progress.ts from d3evil4/scrape: direct link, hf CLI and curl.
- Browser
- Download file 661 Bytes
-
https://huggingface.co/spaces/d3evil4/scrape/resolve/main/lib/progress.ts
- Command line
-
hf download hf://spaces/d3evil4/scrape/lib/progress.ts
-
curl -L -o progress.ts https://huggingface.co/spaces/d3evil4/scrape/resolve/main/lib/progress.ts
661 Bytes
| import type { RenderProgress } from "@/types"; | |
| const progressMap = new Map<string, RenderProgress>(); | |
| export function setProgress(id: string, progress: RenderProgress) { | |
| progressMap.set(id, progress); | |
| // ponytail: every pipeline stage already routes through here, so one line here | |
| // logs the whole run instead of scattering console.log across the pipeline | |
| console.log( | |
| `[reel ${id.slice(0, 8)}] ${progress.percent}% ${progress.stage} — ${progress.message}`, | |
| ); | |
| } | |
| export function getProgress(id: string): RenderProgress | null { | |
| return progressMap.get(id) ?? null; | |
| } | |
| export function clearProgress(id: string) { | |
| progressMap.delete(id); | |
| } | |