pub struct Fim { /* private fields */ }Expand description
Fill-in-the-Middle transform for code training data.
Applies FIM transformation to a text column in a RecordBatch. Each row is randomly split into (prefix, middle, suffix) and reassembled in PSM or SPM format with sentinel tokens.
Rows shorter than min_chars are left unchanged.
Implementations§
Source§impl Fim
impl Fim
Sourcepub fn with_format(self, format: FimFormat) -> Self
pub fn with_format(self, format: FimFormat) -> Self
Set the FIM format variant.
Sourcepub fn with_tokens(self, tokens: FimTokens) -> Self
pub fn with_tokens(self, tokens: FimTokens) -> Self
Set custom sentinel tokens.
Sourcepub fn with_min_chars(self, min_chars: usize) -> Self
pub fn with_min_chars(self, min_chars: usize) -> Self
Set minimum character count for FIM to apply.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fim
impl RefUnwindSafe for Fim
impl Send for Fim
impl Sync for Fim
impl Unpin for Fim
impl UnsafeUnpin for Fim
impl UnwindSafe for Fim
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.