/** * Fetch the model artifacts required by the diarization pipeline. * * Default source is the Hugging Face mirror at * https://huggingface.co/briox/diarization-js-community-1 * which exposes: * - segmentation-3.0.onnx (~6 MB, pyannote/segmentation-3.0, MIT) * - embedding-resnet34.onnx (~26 MB, ResNet34 wespeaker wrapper, CC-BY-4.0) * - plda-params-vbx.json (~1 MB, pyannote VBx PLDA params) * * In Node these are cached on disk under `~/.cache/diarization-js//` * (or `$DIARIZATION_JS_CACHE` if set). In the browser we rely on the HTTP * cache (HF serves with `Cache-Control: max-age=...`); first load fetches * ~33 MB, subsequent loads are served from disk by the browser. * * The library never hard-requires huggingface.co — pass `source` to point at * any mirror that serves the same three filenames at the same paths * (e.g. your own CDN or `file://` paths in tests). */ import type { OrtRuntime } from "./models/ort-runtime.js"; export interface ArtifactProgress { file: "segmentation" | "embedding" | "plda"; loaded: number; total: number; /** 0..1 when total is known, undefined otherwise. */ fraction?: number; } export interface EnsureArtifactsOptions { /** * Base URL or local directory containing the three artifact files at their * default names. Defaults to the official Hugging Face mirror. */ source?: string; /** * Disable on-disk caching in Node. The browser path always relies on the * HTTP cache; this flag is a no-op there. */ cache?: boolean; /** * Override the on-disk cache root in Node. Falls back to * `$DIARIZATION_JS_CACHE`, then `~/.cache/diarization-js/`. */ cacheDir?: string; onProgress?: (p: ArtifactProgress) => void; } export interface DiarizationArtifacts { segmentationModel: Uint8Array; embeddingModel: Uint8Array; pldaParamsJson: unknown; } /** * Optional convenience: pair an `OrtRuntime` with `ensureArtifacts()` output * to get a `PipelineConfig`-shaped object directly. Kept here as a standalone * helper to avoid coupling the artifacts loader to the pipeline constructor. */ export interface DiarizationArtifactsWithRuntime extends DiarizationArtifacts { ort: OrtRuntime; } export declare function ensureArtifacts(options?: EnsureArtifactsOptions): Promise; //# sourceMappingURL=artifacts.d.ts.map