use candle_core::{DType, Device};
use crate::error::Result;
#[cfg_attr(alef, alef(skip))]
#[allow(dead_code)]
#[derive(Debug, Clone)]
pub struct DeepseekOCRProcessor {
device: Device,
dtype: DType,
image_token: String,
image_token_id: u32,
patch_size: u32,
downsample_ratio: u32,
version: usize,
}
impl DeepseekOCRProcessor {
pub fn new(device: &Device, dtype: DType, version: usize) -> Result<Self> {
Ok(Self {
device: device.clone(),
dtype,
image_token: "<image>".to_string(),
image_token_id: 128_815,
patch_size: 16,
downsample_ratio: 4,
version,
})
}
#[must_use]
pub fn image_token_id(&self) -> u32 {
self.image_token_id
}
#[must_use]
pub fn version(&self) -> usize {
self.version
}
#[must_use]
pub fn device(&self) -> &Device {
&self.device
}
#[must_use]
pub fn dtype(&self) -> DType {
self.dtype
}
}