setModelPath method

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

Sets direct path to existing model files

Implementation

@override
Future<void> setModelPath(String path, {String? loraPath}) async {
  await _ensureInitialized();

  final spec = InferenceModelSpec(
    name: path.split('/').last.replaceAll('.bin', '').replaceAll('.task', ''),
    modelUrl: 'file://$path',
    loraUrl: loraPath != null ? 'file://$loraPath' : null,
  );

  await _ensureModelReadySpec(spec);
  _currentActiveModel = spec;
}