isAllowed method

  1. @override
bool isAllowed(
  1. ModelSpec spec
)
override

Returns true if spec is registered in this catalog.

Implements AllowlistProvider for use with ModelDownloader:

final downloader = ModelDownloader(allowlist: ModelCatalog());

This permits downloading of unvalidated models (e.g. multilingual-e5-small prior to its validation pass completing during development). Call lookup (which checks validation status) before loading a model for inference.

Implementation

@override
bool isAllowed(ModelSpec spec) => _catalog.containsKey(spec.id);