* Load model artifacts via HTTP request(s). * * See the documentation to `tf.io.http` for details on the saved * artifacts. * * @returns The loaded model artifacts (if loading succeeds).
()
| 186 | * @returns The loaded model artifacts (if loading succeeds). |
| 187 | */ |
| 188 | async load(): Promise<ModelArtifacts> { |
| 189 | if (this.loadOptions.streamWeights) { |
| 190 | return this.loadStream(); |
| 191 | } |
| 192 | const modelJSON = await this.loadModelJSON(); |
| 193 | return getModelArtifactsForJSON( |
| 194 | modelJSON, (weightsManifest) => this.loadWeights(weightsManifest)); |
| 195 | } |
| 196 | |
| 197 | private async loadStream(): Promise<ModelArtifacts> { |
| 198 | const modelJSON = await this.loadModelJSON(); |
no test coverage detected