pub enum TextGenerationOption {
GPT2(GPT2Generator),
GPT(OpenAIGenerator),
GPTNeo(GptNeoGenerator),
XLNet(XLNetGenerator),
Reformer(ReformerGenerator),
}Expand description
Variants§
GPT2(GPT2Generator)
Text Generator based on GPT2 model
GPT(OpenAIGenerator)
Text Generator based on GPT model
GPTNeo(GptNeoGenerator)
Text Generator based on GPT-Neo model
XLNet(XLNetGenerator)
Text Generator based on XLNet model
Reformer(ReformerGenerator)
Text Generator based on Reformer model
Implementations§
source§impl TextGenerationOption
impl TextGenerationOption
pub fn new(config: TextGenerationConfig) -> Result<Self, RustBertError>
sourcepub fn model_type(&self) -> ModelType
pub fn model_type(&self) -> ModelType
Returns the ModelType for this TextGenerationOption
sourcepub fn get_tokenizer(&self) -> &TokenizerOption
pub fn get_tokenizer(&self) -> &TokenizerOption
Interface method to access tokenizer
sourcepub fn generate_indices<S>(
&self,
prompt_texts: Option<&[S]>,
min_length: Option<i64>,
max_length: Option<i64>
) -> Vec<Vec<i64>> ⓘwhere
S: AsRef<str> + Sync,
pub fn generate_indices<S>(
&self,
prompt_texts: Option<&[S]>,
min_length: Option<i64>,
max_length: Option<i64>
) -> Vec<Vec<i64>> ⓘwhere
S: AsRef<str> + Sync,
Interface method to generate() of the particular models.