Run this model with HF Jobs
Run Synthyra/ESMFold2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Synthyra/ESMFold2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Synthyra/ESMFold2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Synthyra/ESMFold2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/ESMFold2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Synthyra/ESMFold2", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Synthyra/ESMFold2", trust_remote_code=True) model = AutoModel.from_pretrained("Synthyra/ESMFold2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Accept huggingface_hub's shared Xet blob store in the CCD loader (FastPLMs PR 51)
Browse filesFiles changed (4)
291 unmodified lines292293294295296297298291 unmodified linesStructure preparation requires `ccd.pkl` from`biohub/ESMFold2`. The manifest pins its repository, revision, size, contentidentity, and MIT terms. This is a trusted-deserialization boundary. FastPLMsaccepts only the pinned snapshot link inside the repository blob directory.User-supplied asset and `cache_dir` symlinks are rejected. The loader verifies aprivate temporary snapshot before deserialization, protecting againstpath-replacement and in-place source-write races. Offline execution requires the291 unmodified lines292293294295296297298299291 unmodified linesStructure preparation requires `ccd.pkl` from`biohub/ESMFold2`. The manifest pins its repository, revision, size, contentidentity, and MIT terms. This is a trusted-deserialization boundary. FastPLMsaccepts only the pinned snapshot link inside the repository blob directory, orin the Hub's shared Xet blob store through the repository's pinned blob link.User-supplied asset and `cache_dir` symlinks are rejected. The loader verifies aprivate temporary snapshot before deserialization, protecting againstpath-replacement and in-place source-write races. Offline execution requires the
8 unmodified lines9101112131413 unmodified lines282930313233140 unmodified lines1741751761771781791801811821831841851861871881891901911928 unmodified linesimport osimport pickleimport statimport tempfileimport numpy as np13 unmodified lines_CCD_ENVIRONMENT_VARIABLE = "ESMCFOLD_CCD_PATH"_CCD_ASSET_ID = "esmfold2_ccd"@dataclass(frozen=True)140 unmodified lines) from errorresolved = asset_path.resolve(strict=True)blob_root = (repository_cache / "blobs").resolve(strict=True)try:blob_root.relative_to(root)resolved.relative_to(blob_root)except ValueError as error:raise ValueError(f"CCD Hub snapshot link escapes its repository blob cache: {asset_path}") from errorif not resolved.is_file() or resolved.is_symlink():raise ValueError(f"CCD Hub snapshot target must be a regular file: {resolved}")return resolvedclass _ChemicalComponentStore:def __init__(self) -> None:self.molecules: dict[str, Any] | None = None8 unmodified lines910111213141513 unmodified lines29303132333435140 unmodified lines1761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312328 unmodified linesimport osimport pickleimport reimport statimport tempfileimport numpy as np13 unmodified lines_CCD_ENVIRONMENT_VARIABLE = "ESMCFOLD_CCD_PATH"_CCD_ASSET_ID = "esmfold2_ccd"_HEX_DIGEST = re.compile(r"[0-9a-f]{64}")@dataclass(frozen=True)140 unmodified lines) from errorresolved = asset_path.resolve(strict=True)if not (_is_repository_blob(resolved, repository_cache, root)or _is_shared_store_blob(resolved, repository_cache, root, contract.sha256)):raise ValueError("CCD Hub snapshot link escapes its repository blob cache and the shared "f"Hub blob store: {asset_path}")if not resolved.is_file() or resolved.is_symlink():raise ValueError(f"CCD Hub snapshot target must be a regular file: {resolved}")return resolveddef _is_repository_blob(target: Path, repository_cache: Path, root: Path) -> bool:"""Return whether ``target`` lies in the repository's own blob directory."""blob_root = (repository_cache / "blobs").resolve(strict=True)return blob_root.is_relative_to(root) and target.is_relative_to(blob_root)def _is_shared_store_blob(target: Path,repository_cache: Path,root: Path,sha256: str,) -> bool:"""Return whether ``target`` is the shared Xet store entry of the pinned repository blob.Since huggingface_hub 1.32, Xet downloads live once per cache at``<root>/blobs/<xet hash[:2]>/<xet hash>``, and ``models--<repo>/blobs/<sha256>``becomes a relative symlink to that entry. The store name is a Xet hash, not theSHA-256, so the repository blob named by the pinned digest binds the entry tothis asset. ``_open_verified_asset`` still hashes the bytes themselves."""if _HEX_DIGEST.fullmatch(sha256) is None:return Falsestore_root = (root / "blobs").resolve()if not store_root.is_relative_to(root) or not target.is_relative_to(store_root):return Falsestore_parts = target.relative_to(store_root).partsif (len(store_parts) != 2or _HEX_DIGEST.fullmatch(store_parts[1]) is Noneor store_parts[0] != store_parts[1][:2]):return Falserepository_blob = repository_cache / "blobs" / sha256return repository_blob.is_symlink() and repository_blob.resolve() == targetclass _ChemicalComponentStore:def __init__(self) -> None:self.molecules: dict[str, Any] | None = None
12 unmodified lines1314151617181912 unmodified linesfrom .fastplms_bundle import RUNTIME_DATA, RUNTIME_HASHif RUNTIME_HASH != "2ef7cccec8dfd129c6621d7bbb4b9f91a0ed1be1fd3f62d670259a4a9e199af0":raise RuntimeError("FastPLMs runtime identity differs from the bridge.")_RUNTIME_TEMPORARIES = []12 unmodified lines1314151617181912 unmodified linesfrom .fastplms_bundle import RUNTIME_DATA, RUNTIME_HASHif RUNTIME_HASH != "9eaca231522bbd565f9359301d8c51391e8e512d522ebca5f0d8119d666537fd":raise RuntimeError("FastPLMs runtime identity differs from the bridge.")_RUNTIME_TEMPORARIES = []
README.md+2-1
fastplms/models/esmfold2/esmfold2_conformers.py+47-7
fastplms_bundle.py
modeling_fastplms.py+1-1