getModelFilePaths method

  1. @override
Future<Map<String, String>?> getModelFilePaths(
  1. ModelSpec spec
)
override

Gets the file paths for an installed model

Implementation

@override
Future<Map<String, String>?> getModelFilePaths(ModelSpec spec) async {
  await _ensureInitialized();

  try {
    if (!await isModelInstalled(spec)) {
      return null;
    }

    final filePaths = <String, String>{};

    for (final file in spec.files) {
      final path = await ModelFileSystemManager.getModelFilePath(file.filename);
      filePaths[file.prefsKey] = path;
    }

    return filePaths;
  } catch (e) {
    debugPrint('UnifiedModelManager: Failed to get file paths for ${spec.name}: $e');
    return null;
  }
}