Image Feature Extraction
Transformers
Safetensors
esmfold2
biology
protein-structure
multimodal-protein-model
custom_code
Instructions to use Synthyra/ESMFold2-Fast with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/ESMFold2-Fast with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="Synthyra/ESMFold2-Fast", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Synthyra/ESMFold2-Fast", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
| from __future__ import annotations | |
| import io | |
| from dataclasses import dataclass | |
| from pathlib import Path | |
| from typing import Union | |
| from cloudpathlib import CloudPath | |
| PathLike = Union[str, Path, CloudPath] | |
| PathOrBuffer = Union[PathLike, io.StringIO] | |
| class FunctionAnnotation: | |
| """Represents an annotation of a protein's function over a range of residues. | |
| Fields: | |
| label (str): An entry in either the function_tokens or residue_annotations tokenizer vocabs | |
| start (int): Start index of this annotation. 1-indexed, inclusive. | |
| end (int): End index of this annotation. 1-indexed, inclusive. | |
| """ | |
| label: str | |
| start: int | |
| end: int | |
| def to_tuple(self) -> tuple[str, int, int]: | |
| return self.label, self.start, self.end | |
| def __len__(self) -> int: | |
| """Length of the annotation.""" | |
| return self.end - self.start + 1 | |