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("feature-extraction", model="Synthyra/ESMFold2-Fast", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Synthyra/ESMFold2-Fast", trust_remote_code=True) model = AutoModel.from_pretrained("Synthyra/ESMFold2-Fast", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download fastplms/json_files.py from Synthyra/ESMFold2-Fast: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/Synthyra/ESMFold2-Fast/resolve/main/fastplms/json_files.py
- Command line
-
hf download hf://Synthyra/ESMFold2-Fast/fastplms/json_files.py
-
curl -L -o json_files.py https://huggingface.co/Synthyra/ESMFold2-Fast/resolve/main/fastplms/json_files.py
1.31 kB
| """The two JSON text forms FastPLMs writes: compact for hashing, indented for files people read. | |
| This file exists twice, byte for byte: here and as ``features/json_files.py``. ``features`` loads as a | |
| standalone package (``foundry.embedding.private_store``) and imports nothing outside itself, so it cannot | |
| reach this module. ``tests/tier1_unit/test_features_package_is_self_contained.py`` fails when the two differ. | |
| """ | |
| from __future__ import annotations | |
| import json | |
| from typing import Any | |
| def compact_json(value: Any, *, ensure_ascii: bool = True, allow_nan: bool = True) -> str: | |
| """Serialize with sorted keys and no whitespace, the form a digest or an identity is taken over.""" | |
| return json.dumps( | |
| value, | |
| sort_keys=True, | |
| separators=(",", ":"), | |
| ensure_ascii=ensure_ascii, | |
| allow_nan=allow_nan, | |
| ) | |
| def indented_json( | |
| value: Any, | |
| *, | |
| ensure_ascii: bool = True, | |
| allow_nan: bool = True, | |
| sort_keys: bool = True, | |
| ) -> str: | |
| """Serialize with two-space indentation and one trailing newline, the form of a stored JSON file.""" | |
| return ( | |
| json.dumps( | |
| value, | |
| indent=2, | |
| sort_keys=sort_keys, | |
| ensure_ascii=ensure_ascii, | |
| allow_nan=allow_nan, | |
| ) | |
| + "\n" | |
| ) | |