pub struct ESM3Runner { /* private fields */ }Expand description
Wraps a loaded ESM3 model for sequence embedding and multi-track inference.
§HuggingFace access
The ESM3 model is gated. Before calling from_pretrained the user must:
- Accept the Cambrian Non-Commercial license at https://huggingface.co/EvolutionaryScale/esm3-sm-open-v1
- Run
huggingface-cli login(or setHF_TOKENenv var)
Implementations§
Source§impl ESM3Runner
impl ESM3Runner
Sourcepub fn from_pretrained(variant: ESM3Models, device: Device) -> Result<Self>
pub fn from_pretrained(variant: ESM3Models, device: Device) -> Result<Self>
Download the ESM3 weights from HuggingFace and load the model.
The .pth checkpoint is loaded directly via candle_core::pickle::PthTensors.
Sourcepub fn embed_sequence(&self, sequence: &str) -> Result<Tensor>
pub fn embed_sequence(&self, sequence: &str) -> Result<Tensor>
Tokenize sequence and return per-residue embeddings (1, L, d_model).
Only the sequence track is provided; all other tracks are None.
Embeddings are the pre-norm transformer hidden states (raw activations).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ESM3Runner
impl !RefUnwindSafe for ESM3Runner
impl !Send for ESM3Runner
impl !Sync for ESM3Runner
impl Unpin for ESM3Runner
impl UnsafeUnpin for ESM3Runner
impl !UnwindSafe for ESM3Runner
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
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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