use crate::CandleError;
#[derive(Debug)]
pub struct ModelData {
pub config: Vec<u8>,
pub tokenizer: Vec<u8>,
pub weights: Vec<u8>,
}
#[derive(Debug, Clone, Copy)]
pub struct GgufModelData<'a> {
pub config: &'a [u8],
pub tokenizer: &'a [u8],
pub weights: &'a [u8],
}
#[derive(Debug)]
pub enum ModelArtifacts {
Safetensors(ModelData),
Gguf(ModelData),
}
pub(crate) fn require_nonempty(bytes: &[u8], artifact: &'static str) -> Result<(), CandleError> {
if bytes.is_empty() {
Err(CandleError::EmptyBuffer { artifact })
} else {
Ok(())
}
}