ModelByteSource

Random-access, read-only bytes of a model file, used by the header parsers.

Parsers only read the header and skip tensor data by position, so model weights are never loaded into memory.

Inheritors

Properties

Link copied to clipboard
abstract val size: Long

Total size in bytes, or -1 if unknown (a stream whose end is only found by reading).

Functions

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
abstract fun read(position: Long, buffer: ByteArray, offset: Int, length: Int): Int

Reads up to length bytes starting at file offset position into buffer at offset.