isSmallFile static method

bool isSmallFile(
  1. String extension
)

Checks if file extension requires smaller minimum size

Some files (configs, tokenizers) are naturally small and don't need the 1MB minimum size check that model files require.

Small file extensions:

  • .json (config files, typically <100KB)
  • .model (SentencePiece tokenizers, typically <500KB)

Platform Support: All

Parameters:

  • extension: File extension to check (with leading dot, e.g., '.json')

Returns: true if extension is for small files, false otherwise

Implementation

static bool isSmallFile(String extension) {
  const smallFileExtensions = ['.json', '.model'];
  return smallFileExtensions.contains(extension);
}