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
| import io | |
| import subprocess | |
| import typing as T | |
| from pathlib import Path | |
| PathLike = T.Union[str, Path] | |
| PathOrBuffer = T.Union[PathLike, io.StringIO] | |
| def run_subprocess_with_errorcheck( | |
| *popenargs, | |
| capture_output: bool = False, | |
| quiet: bool = False, | |
| env: dict[str, str] | None = None, | |
| shell: bool = False, | |
| executable: str | None = None, | |
| **kws, | |
| ) -> subprocess.CompletedProcess: | |
| """A command similar to subprocess.run, however the errormessage will | |
| contain the stderr when using this function. This makes it significantly | |
| easier to diagnose issues. | |
| """ | |
| try: | |
| if capture_output: | |
| stdout = subprocess.PIPE | |
| elif quiet: | |
| stdout = subprocess.DEVNULL | |
| else: | |
| stdout = None | |
| p = subprocess.run( | |
| *popenargs, | |
| stderr=subprocess.PIPE, | |
| stdout=stdout, | |
| check=True, | |
| env=env, | |
| shell=shell, | |
| executable=executable, | |
| **kws, | |
| ) | |
| except subprocess.CalledProcessError as e: | |
| raise RuntimeError( | |
| f"Command failed with errorcode {e.returncode}." f"\n\n{e.stderr.decode()}" | |
| ) | |
| return p | |