[−][src]Struct rust_bert::pipelines::generation::BartGenerator
Methods
impl BartGenerator[src]
pub fn new(generate_config: GenerateConfig) -> Fallible<BartGenerator>[src]
Build a new BartGenerator
Arguments
vocab_path- Path to the model vocabulary, expected to have a structure following the Transformers library conventionmerges_path- Path to the bpe merges, expected to have a structure following the Transformers library conventionconfig_path- Path to the model configuration, expected to have a structure following the Transformers library conventionweights_path- Path to the model weight files. These need to be converted form the.binto.otformat using the utility script provided.device- Device to run the model on, e.g.Device::CpuorDevice::Cuda(0)
Example
use rust_bert::pipelines::generation::{GenerateConfig, BartGenerator}; let device = Device::cuda_if_available(); let generate_config = GenerateConfig { max_length: 30, do_sample: true, num_beams: 5, temperature: 1.1, num_return_sequences: 3, ..Default::default() }; let bart_generator = BartGenerator::new(generate_config)?;
Trait Implementations
impl LanguageGenerator<BartForConditionalGeneration, RobertaVocab, RobertaTokenizer> for BartGenerator[src]
Auto Trait Implementations
impl !RefUnwindSafe for BartGenerator
impl !Send for BartGenerator
impl !Sync for BartGenerator
impl Unpin for BartGenerator
impl !UnwindSafe for BartGenerator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,