pub struct Open { /* private fields */ }Expand description
How to open. Mirrors ztensor::read::Options, minus shard resolution:
no foreign format has a shard table.
Implementations§
Source§impl Open
impl Open
pub fn vocabulary(self, vocab: &Vocabulary) -> Self
Sourcepub fn map(self, map: bool) -> Self
pub fn map(self, map: bool) -> Self
Map the files (the default). With false, files are opened but not
mapped: metadata and addresses are available, borrowed reads are not.
Sourcepub fn open(self, path: impl AsRef<Path>) -> Result<Source>
pub fn open(self, path: impl AsRef<Path>) -> Result<Source>
Opens one file of any supported format.
Sourcepub fn open_all(self, paths: &[impl AsRef<Path>]) -> Result<Source>
pub fn open_all(self, paths: &[impl AsRef<Path>]) -> Result<Source>
Opens several files as one name space.
What a sharded snapshot is: model-00001-of-00003.safetensors and its
siblings are each a whole file that describes itself, and the index
beside them is a naming convention outside the format. So this is a
list of paths and nothing more. The caller decides which files belong
together, because the files themselves never said.
The set may mix formats. Nothing here requires them to match: what makes it a model is that the names do not collide, which the merge checks.