pub struct ESM2Runner { /* private fields */ }Implementations§
Source§impl ESM2Runner
impl ESM2Runner
Sourcepub fn load_model(modeltype: ESM2Models, device: Device) -> Result<ESM2Runner>
pub fn load_model(modeltype: ESM2Models, device: Device) -> Result<ESM2Runner>
Load model from HuggingFace hub, downloading config.json, tokenizer files, and weights.
pub fn run_forward(&self, prot_sequence: &str) -> Result<ESM2Output>
Sourcepub fn predict_contacts(&self, prot_sequence: &str) -> Result<Tensor>
pub fn predict_contacts(&self, prot_sequence: &str) -> Result<Tensor>
Predict residue-residue contact probabilities for a single protein sequence.
Returns a (seq_len, seq_len) contact probability matrix (BOS/EOS stripped,
so dimensions equal the number of amino acids in prot_sequence).
pub fn decode_logits(&self, output: ESM2Output) -> Result<String>
Auto Trait Implementations§
impl !Freeze for ESM2Runner
impl !RefUnwindSafe for ESM2Runner
impl Send for ESM2Runner
impl Sync for ESM2Runner
impl Unpin for ESM2Runner
impl UnsafeUnpin for ESM2Runner
impl !UnwindSafe for ESM2Runner
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> 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