pub struct Master<TG, IG> {
pub ctx: Context,
pub llm_model: Option<Box<TG>>,
pub sd_model: Option<Box<IG>>,
}Expand description
A master connects to, communicates with and orchestrates the workers.
Fields§
§ctx: Context§llm_model: Option<Box<TG>>§sd_model: Option<Box<IG>>Implementations§
Source§impl<TG: TextGenerator + Send + Sync + 'static, IG: ImageGenerator + Send + Sync + 'static> Master<TG, IG>
impl<TG: TextGenerator + Send + Sync + 'static, IG: ImageGenerator + Send + Sync + 'static> Master<TG, IG>
pub async fn run(self) -> Result<()>
Sourcepub async fn generate_text<S>(
&mut self,
max_tokens: Option<usize>,
stream: S,
) -> Result<()>
pub async fn generate_text<S>( &mut self, max_tokens: Option<usize>, stream: S, ) -> Result<()>
Start the generation loop and call the stream function for every token.
max_tokens overrides the default sample length if provided.
pub async fn generate_image<F>( &mut self, args: ImageGenerationArgs, callback: F, ) -> Result<()>
Auto Trait Implementations§
impl<TG, IG> Freeze for Master<TG, IG>
impl<TG, IG> !RefUnwindSafe for Master<TG, IG>
impl<TG, IG> Send for Master<TG, IG>
impl<TG, IG> Sync for Master<TG, IG>
impl<TG, IG> Unpin for Master<TG, IG>
impl<TG, IG> UnsafeUnpin for Master<TG, IG>
impl<TG, IG> !UnwindSafe for Master<TG, IG>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more