installModelFromAsset method

  1. @override
Future<void> installModelFromAsset(
  1. String path, {
  2. String? loraPath,
})
override

Installs from asset

Implementation

@override
Future<void> installModelFromAsset(String path, {String? loraPath}) async {
  final modelFileName = Uri.parse(path).pathSegments.last;
  _modelFileName = modelFileName;

  final prefs = await _prefs;
  await prefs.setString(_prefsModelKey, modelFileName);

  await Future.wait([
    _loadModelIfNeeded(() => _largeFileHandler.copyAssetToLocalStorage(
      assetName: path,
      targetPath: modelFileName,
    )),
    if (loraPath != null) installLoraWeightsFromAsset(loraPath),
  ]);
}