(modelSource: TFDFLoadHandlerSync)
| 191 | */ |
| 192 | |
| 193 | export 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…