use anyhow::Result;
use candle_core::Tensor;
pub mod embedding;
pub mod generate;
pub mod gguf;
pub mod model_mapping;
pub mod modules;
pub mod reranker;
#[derive(Clone, Debug)]
pub struct MultiModalData {
pub data_vec: Vec<Option<Tensor>>,
}
impl MultiModalData {
pub fn new(data_vec: Vec<Option<Tensor>>) -> Self {
Self { data_vec }
}
}
#[allow(unused)]
pub trait InferenceModel {
fn forward_initial(
&mut self,
input_ids: &Tensor,
seqlen_offset: usize,
data: MultiModalData,
) -> Result<Tensor> {
Self::forward_step(self, input_ids, seqlen_offset)
}
fn forward_step(&mut self, input_ids: &Tensor, seqlen_offset: usize) -> Result<Tensor>;
fn clear_cache(&mut self);
fn stop_token_ids(&self) -> Vec<u32>;
}