in src/plugin/utils/file_storage.ts [215:237]
async load(): Promise<io.ModelArtifacts> {
const info = JSON.parse(
(await readFile(this.fsm, this.paths.info, 'utf-8')) as string);
if (info == null) {
throw new Error(
`In file storage, there is no model with name '${this.prefix}'`);
}
if (info.modelTopologyType !== 'JSON') {
throw new Error(
'fileStorage does not support loading non-JSON model ' +
'topology yet.');
}
const modelArtifacts = JSON.parse(
(await readFile(
this.fsm, this.paths.modelArtifactsWithoutWeights, 'utf-8')) as
string);
// load weight data
modelArtifacts.weightData = await readFile(this.fsm, this.paths.weightData);
return modelArtifacts;
}