pub struct WhisperGraphCtx {
pub cfg: WhisperConfig,
pub pfx: WhisperWeightPrefix,
pub weights: Arc<HashMap<String, (Vec<f32>, Vec<usize>)>>,
pub enc_seq: usize,
pub mel_frames: usize,
pub graph_opts: WhisperGraphOpts,
pub fused: Option<FusedDecoderWeights>,
pub fused_enc: Option<FusedEncoderWeights>,
}Expand description
Shared checkpoint + graph options (cheap Clone via Arc weights).
Fields§
§cfg: WhisperConfig§pfx: WhisperWeightPrefix§weights: Arc<HashMap<String, (Vec<f32>, Vec<usize>)>>§enc_seq: usize§mel_frames: usize§graph_opts: WhisperGraphOpts§fused: Option<FusedDecoderWeights>§fused_enc: Option<FusedEncoderWeights>Implementations§
Source§impl WhisperGraphCtx
impl WhisperGraphCtx
pub fn weight_map(&self) -> WeightMap
pub fn build_encoder(&self, batch: usize) -> Result<BuiltModel, Error>
pub fn build_cross(&self, batch: usize) -> Result<BuiltModel, Error>
pub fn build_prefill( &self, batch: usize, dec_seq: usize, ) -> Result<BuiltModel, Error>
pub fn build_decode_step( &self, batch: usize, bucket_upper: usize, ) -> Result<BuiltModel, Error>
Trait Implementations§
Source§impl Clone for WhisperGraphCtx
impl Clone for WhisperGraphCtx
Source§fn clone(&self) -> WhisperGraphCtx
fn clone(&self) -> WhisperGraphCtx
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WhisperGraphCtx
impl RefUnwindSafe for WhisperGraphCtx
impl Send for WhisperGraphCtx
impl Sync for WhisperGraphCtx
impl Unpin for WhisperGraphCtx
impl UnsafeUnpin for WhisperGraphCtx
impl UnwindSafe for WhisperGraphCtx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more