Spaces:
Runtime error
Runtime error
Download lib/samStatus.ts from richuj/tile-room-visualizer: direct link, hf CLI and curl.
- Browser
- Download file 599 Bytes
-
https://huggingface.co/spaces/richuj/tile-room-visualizer/resolve/main/lib/samStatus.ts
- Command line
-
hf download hf://spaces/richuj/tile-room-visualizer/lib/samStatus.ts
-
curl -L -o samStatus.ts https://huggingface.co/spaces/richuj/tile-room-visualizer/resolve/main/lib/samStatus.ts
599 Bytes
| import { existsSync } from "node:fs"; | |
| export type SamStatus = { | |
| checkpointConfigured: boolean; | |
| checkpointExists: boolean; | |
| modelType: string; | |
| python: string; | |
| }; | |
| export function getSamStatus(): SamStatus { | |
| const checkpoint = process.env.SAM_CHECKPOINT; | |
| const localPython = `${process.cwd()}/.venv/bin/python`; | |
| return { | |
| checkpointConfigured: Boolean(checkpoint), | |
| checkpointExists: checkpoint ? existsSync(checkpoint) : false, | |
| modelType: process.env.SAM_MODEL_TYPE ?? "vit_h", | |
| python: process.env.SAM_PYTHON ?? (existsSync(localPython) ? localPython : "python3") | |
| }; | |
| } | |