ensureFonnxRuntimeModel function
Downloads modelPath into directory, verifies its pinned SHA-256, and
returns the local file.
An already downloaded file is reused only after it passes the same check.
The atomic download and verification are provided by
kiln/runtime.dart (kiln ADR 001 D13).
Implementation
Future<File> ensureFonnxRuntimeModel(
String modelPath,
Directory directory, {
Map<String, RuntimeFile> runtimeFiles = prebuiltRuntimeFiles,
HttpClient? client,
void Function(int received, int? total)? onProgress,
}) {
return ensureRuntimeFile(
runtimeModelFile(modelPath, runtimeFiles),
directory,
client: client,
onProgress: onProgress,
);
}