pub enum ConversationOption {
GPT2(GPT2Generator),
}
Expand description
§Abstraction that holds one particular conversation model, for any of the supported models
Variants§
GPT2(GPT2Generator)
Conversation based on GPT2 model
Implementations§
Source§impl ConversationOption
impl ConversationOption
pub fn new(config: ConversationConfig) -> Result<Self, RustBertError>
pub fn new_with_tokenizer( config: ConversationConfig, tokenizer: TokenizerOption, ) -> Result<Self, RustBertError>
pub fn get_eos_id(&self) -> Result<i64, RustBertError>
Sourcepub fn get_tokenizer(&self) -> &TokenizerOption
pub fn get_tokenizer(&self) -> &TokenizerOption
Get a reference to the model tokenizer.
Sourcepub fn get_tokenizer_mut(&mut self) -> &TokenizerOption
pub fn get_tokenizer_mut(&mut self) -> &TokenizerOption
Get a mutable reference to the model tokenizer.
Sourcepub fn model_type(&self) -> ModelType
pub fn model_type(&self) -> ModelType
Returns the ModelType
for this ConversationOption
Sourcepub fn generate_from_ids_and_past(
&self,
input_ids: Tensor,
attention_mask: Option<Tensor>,
) -> Result<Vec<Vec<i64>>, RustBertError>
pub fn generate_from_ids_and_past( &self, input_ids: Tensor, attention_mask: Option<Tensor>, ) -> Result<Vec<Vec<i64>>, RustBertError>
Interface method to generate_from_ids_and_past() of the particular models.
Auto Trait Implementations§
impl !Freeze for ConversationOption
impl !RefUnwindSafe for ConversationOption
impl Send for ConversationOption
impl !Sync for ConversationOption
impl Unpin for ConversationOption
impl !UnwindSafe for ConversationOption
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> 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