pub struct Platform;Implementations§
Source§impl Platform
impl Platform
pub fn new() -> Self
Sourcepub fn load_model(&self, model_id: &str) -> Result<LoadedModel>
pub fn load_model(&self, model_id: &str) -> Result<LoadedModel>
Instantiate a synthetic InferenceEngine with default dimensions. Use this when no pre-trained weights are available.
Sourcepub fn load_model_from_file(&self, path: &str) -> Result<LoadedModel>
pub fn load_model_from_file(&self, path: &str) -> Result<LoadedModel>
Load a real ternarized model from a .tern.bin file.
The file must be a ModelCoherence binary produced by scripts/transmute_llama.py.
Layers are mapped round-robin to the 13 EPIS experts.
use moe_platform::Platform;
let platform = Platform::new();
let model = platform.load_model_from_file("/path/to/llama32-1b.tern.bin").unwrap();
let result = platform.run_inference(&model, "Should we proceed?").unwrap();
println!("Verdict: {}", result.trit_verdict);Sourcepub fn run_inference(
&self,
model: &LoadedModel,
prompt: &str,
) -> Result<InferenceResult>
pub fn run_inference( &self, model: &LoadedModel, prompt: &str, ) -> Result<InferenceResult>
Run a forward pass and return a structured ternary result.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Platform
impl RefUnwindSafe for Platform
impl Send for Platform
impl Sync for Platform
impl Unpin for Platform
impl UnsafeUnpin for Platform
impl UnwindSafe for Platform
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