Struct chat_flame_backend::llm::text_generator::TextGenerator
source · pub struct TextGenerator { /* private fields */ }
Expand description
Handles the text generation process.
This struct is responsible for managing the token generation and converting tokens into text.
Implementations§
source§impl TextGenerator
impl TextGenerator
sourcepub fn new(
tokenizer: TokenOutputStream,
token_generator: Box<dyn TokenGeneratorTrait>
) -> Self
pub fn new( tokenizer: TokenOutputStream, token_generator: Box<dyn TokenGeneratorTrait> ) -> Self
Constructs a new TextGenerator
.
Arguments
tokenizer
- Tokenizer for encoding prompts and decoding generated tokens.token_generator
- Token generator that provides the logic for generating tokens.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TextGenerator
impl Send for TextGenerator
impl !Sync for TextGenerator
impl Unpin for TextGenerator
impl !UnwindSafe for TextGenerator
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