UNPKG

@ignitionai/backend-tfjs

Version:

TensorFlow.js backend for IgnitionAI - browser-based reinforcement learning framework

15 lines (14 loc) 782 B
import * as tf from '@tensorflow/tfjs'; /** * Load a TensorFlow.js model hosted on Hugging Face Hub. * GraphModel is faster and more efficient for inference, but requires more memory. * If you want to fine-tune the model, use LayersModel. * * @param repoId string - full repo name (e.g. "salim4n/my-dqn-model") * @param filename string - defaults to "model.json" * @param graphModel boolean - defaults to false * @param maxRetries number - max number of retry attempts * @param initialDelay number - initial delay in ms before first retry * @returns tf.LayersModel - the loaded model */ export declare function loadModelFromHub(repoId: string, filename?: string, graphModel?: boolean, maxRetries?: number, initialDelay?: number): Promise<tf.LayersModel | tf.GraphModel>;