installModelFromAssetWithProgress method

  1. @override
Stream<int> installModelFromAssetWithProgress(
  1. String path, {
  2. String? loraPath,
})
override

Installs the model and lora weights from the asset with progress.

Model should be loaded before initialization.

This method can be safely called multiple times. Model and lora weights will be loaded only if they doesn't exist.

To reload the model, call deleteModel first. To reload the lora weights, call deleteLoraWeights first.

This method should be used only for development purpose. Never embed neither model nor lora weights in the production app.

Implementation

@override
Stream<int> installModelFromAssetWithProgress(String path,
    {String? loraPath}) {
  if (kReleaseMode) {
    throw UnsupportedError(
        "Method loadAssetModelWithProgress should not be used in the release build");
  }
  return _loadModelWithProgress(
      'assets/$path', loraPath != null ? 'assets/$loraPath' : null);
}