timesfm-ts - v1.0.0
    Preparing search index...

    Function loadModelFromUrl

    • Download a TimesFM ONNX model from a URL.

      Uses the Fetch API with ReadableStream for progress tracking. The returned ArrayBuffer can be passed directly to TimesFMWebInferenceEngine.load().

      Parameters

      • url: string

        URL of the ONNX model file.

      • options: ModelLoaderOptions = {}

        Progress callback and AbortSignal.

      Returns Promise<ModelLoadResult>

      The model as an ArrayBuffer with metadata.

      import { loadModelFromUrl } from '@agentix-e/timesfm-web';

      const { buffer } = await loadModelFromUrl(
      'https://github.com/.../releases/download/timesfm-latest/timesfm-2.5.onnx',
      {
      onProgress: (received, total) => {
      console.log(`Downloaded ${(received / 1024 / 1024).toFixed(1)} MB`);
      },
      },
      );

      // Pass buffer to the engine
      engine.load(buffer);