ggus/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#![doc = include_str!("../README.md")]
#![deny(warnings)]

pub extern crate ggml_quants;

mod file;
mod header;
mod metadata;
mod name;
mod read;
mod tensor;
mod write;

pub use file::{GGuf, GGufError};
pub use header::GGufFileHeader;
pub use metadata::{
    GGmlTokenType, GGufFileType, GGufMetaDataValueType, GGufMetaError, GGufMetaKV, GGufMetaMap,
    GGufMetaMapExt, GGufMetaValueArray, DEFAULT_ALIGNMENT, GENERAL_ALIGNMENT,
};
pub use name::{GGufFileName, GGufShardParseError};
pub use read::{GGufReadError, GGufReader};
pub use tensor::{GGmlType, GGmlTypeSize, GGufTensorInfo, GGufTensorMeta};
pub use write::{
    DataFuture, GGufFileSimulator, GGufFileWriter, GGufTensorSimulator, GGufTensorWriter,
    GGufWriter,
};

#[inline(always)]
const fn pad(pos: usize, align: usize) -> usize {
    (align - pos % align) % align
}