in packages/cli/src/standalone-impl.ts [17:27]
async saveModel(localPathOrStream: string | NodeJS.ReadableStream, filename: 'model'): Promise<void> {
if (typeof localPathOrStream === 'string') {
if (path.parse(localPathOrStream).dir === this.modelDir || this.modelDir === path.resolve(localPathOrStream)) {
return;
}
return fs.copy(localPathOrStream, this.modelDir);
} else {
const modelStream = fs.createWriteStream(path.join(this.modelDir, filename));
return pipelineAsync(localPathOrStream, modelStream);
}
}