[−][src]Struct rust_bert::pipelines::generation::GPT2Generator
Methods
impl GPT2Generator
[src]
pub fn new(generate_config: GenerateConfig) -> Fallible<GPT2Generator>
[src]
Build a new GPT2Generator
Arguments
generate_config
-GenerateConfig
object containing the resource references (model, vocabulary, configuration), generation options and device placement (CPU/GPU)
Example
use rust_bert::pipelines::generation::{GenerateConfig, GPT2Generator}; let generate_config = GenerateConfig { max_length: 30, do_sample: true, num_beams: 5, temperature: 1.1, num_return_sequences: 3, ..Default::default() }; let gpt2_generator = GPT2Generator::new(generate_config)?;
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for GPT2Generator
impl !Send for GPT2Generator
impl !Sync for GPT2Generator
impl Unpin for GPT2Generator
impl !UnwindSafe for GPT2Generator
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>,