loadModel method

Future<bool> loadModel(
  1. String modelPath
)

Load a GGUF model file. Idempotent for the same path; replaces the model on the existing engine when called with a different path.

Implementation

Future<bool> loadModel(String modelPath) async {
  await initialize();
  if (!File(modelPath).existsSync()) {
    throw SyniRuntimeError('Model file not found: $modelPath');
  }
  await _worker!.loadModel(modelPath);
  _modelPath = modelPath;
  return true;
}