getModelFolderAndCreate method

Future<String> getModelFolderAndCreate(
  1. String modelId,
  2. InferenceFramework framework
)

Get model folder, creating it if it doesn't exist. This is the main method for download service to use.

Implementation

Future<String> getModelFolderAndCreate(
    String modelId, InferenceFramework framework) async {
  // Get path from C++
  final path = getModelFolder(modelId, framework);
  if (path != null) {
    _ensureDirectoryExists(path);
    return path;
  }

  // C++ not configured - throw error (SDK not initialized)
  throw StateError(
      'Model paths not configured. Call RunAnywhere.initialize() first.');
}