Struct chat_flame_backend::llm::text_generation::TextGeneration
source · pub struct TextGeneration { /* private fields */ }
Implementations§
source§impl TextGeneration
impl TextGeneration
pub fn new(model: Model, tokenizer: Tokenizer, _device: &Device) -> Self
pub fn run( &mut self, prompt: &str, parameter: GenerateParameter ) -> Result<Option<String>>
pub fn run_stream( &mut self, prompt: &str, parameter: GenerateParameter, _stop_tokens: Option<Vec<String>> ) -> impl Stream<Item = StreamResponse>
Trait Implementations§
source§impl Clone for TextGeneration
impl Clone for TextGeneration
source§fn clone(&self) -> TextGeneration
fn clone(&self) -> TextGeneration
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TextGeneration
impl Send for TextGeneration
impl Sync for TextGeneration
impl Unpin for TextGeneration
impl !UnwindSafe for TextGeneration
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