MCPcopy Create free account
hub / github.com/tensorflow/tfjs / loadTFDFModelSync

Function loadTFDFModelSync

tfjs-tfdf/src/tfdf_model.ts:193–212  ·  view source on GitHub ↗
(modelSource: TFDFLoadHandlerSync)

Source from the content-addressed store, hash-verified

191 */
192
193export function loadTFDFModelSync(modelSource: TFDFLoadHandlerSync): TFDFModel {
194 if (modelSource == null) {
195 throw new Error(
196 'modelUrl in loadTFDFModelSync() cannot be null. Please provide a ' +
197 'url or an TFDFLoadHandlerSync that loads the model');
198 }
199 if (!modelSource.loadModel) {
200 throw new Error(
201 `modelUrl IO Handler ${modelSource} has no loadModel function`);
202 }
203 if (!modelSource.loadAssets) {
204 throw new Error(
205 `modelUrl IO Handler ${modelSource} has no loadAssets function`);
206 }
207
208 const graphModelSource = {load: modelSource.loadModel};
209 const assets = modelSource.loadAssets();
210 const graphModel = loadGraphModelSync(graphModelSource);
211 return new TFDFModel(graphModel, assets);
212}

Callers

nothing calls this directly

Calls 1

loadGraphModelSyncFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…