linearAttentionState method

Future<bool?> linearAttentionState(
  1. String path
)

Whether the model at path keeps linear attention state; null when the file cannot be read to tell.

Implementation

Future<bool?> linearAttentionState(String path) async {
  Object cause;
  try {
    return await readLiteRtLmHasLinearAttentionState(path);
  } on LiteRtLmBundleException catch (e) {
    cause = e;
  } on FileSystemException catch (e) {
    cause = e;
  }
  // ignore: avoid_print
  print(
    '[litertlm_dart] could not read whether this model keeps linear '
    'attention state ($cause): its conversations are rebuilt from full '
    'messages after a stop or a full context, never rewound.',
  );
  return null;
}