Class BundledOnnxModelSource
An app-packaged asset, copied out once. The opener is the consumer's - in MAUI that is
FileSystem.OpenAppPackageFileAsync - so this package never references MAUI.
public sealed class BundledOnnxModelSource : IOnnxModelSource
- Inheritance
-
BundledOnnxModelSource
- Implements
- Inherited Members
Remarks
The copy is unavoidable. On Android a MauiAsset is an AssetManager stream with no
path and no length, and spec 9.1 requires a real path: a byte-array session doubles transient
memory and degrades ORT's CoreML cache key from the model-URL hash to a hash of graph inputs and
node outputs, which collides across quantization variants of one architecture.
Constructors
- BundledOnnxModelSource(IEdgeModelPaths, Func<string, CancellationToken, ValueTask<Stream>>)
Creates the source.
Properties
- Name
A short stable name, used in logs and in provisioning failures.
Methods
- CanProvide(OnnxModelManifest)
Whether this source could supply the manifest at all. Cheap and synchronous: it inspects the manifest, never the network.
- EnsureAsync(OnnxModelManifest, IProgress<ModelProvisioningProgress>?, CancellationToken)
Materialises every file into
<Models>/<modelId>/<sha16>, verifying each digest, and returns the resolved paths.