pub struct LogitBias {
pub base_logit_bias: Option<HashMap<u32, f32>>,
pub built_openai_bias: OpenAILogitBias,
/* private fields */
}
Fields§
§base_logit_bias: Option<HashMap<u32, f32>>
§built_openai_bias: OpenAILogitBias
Implementations§
Source§impl LogitBias
impl LogitBias
pub fn new() -> Self
pub fn add_token_id(&mut self, token_id: u32, bias: f32) -> &mut Self
pub fn add_token_ids(&mut self, logit_bias: HashMap<u32, f32>) -> &mut Self
pub fn add_from_char(&mut self, char: char, bias: f32) -> &mut Self
pub fn add_from_word(&mut self, word: &str, bias: f32) -> &mut Self
pub fn add_from_text(&mut self, text: &str, bias: f32) -> &mut Self
pub fn clear_logit_bias(&mut self) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogitBias
impl RefUnwindSafe for LogitBias
impl Send for LogitBias
impl Sync for LogitBias
impl Unpin for LogitBias
impl UnwindSafe for LogitBias
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 more