save method

void save(
  1. String path
)

Writes the directions (not mode, scale or range) to path as safetensors: F32 tensors direction.<l> of shape hiddenSize, in layer order. Written through a temporary file and a rename.

Implementation

void save(String path) {
  final layers = directions.keys.toList()..sort();
  final temp = '$path.partial';
  writeSafetensorsF32(temp, {
    for (final l in layers) 'direction.$l': ([hiddenSize], directions[l]!),
  });
  File(temp).renameSync(path);
}