Instructions to use Synthyra/ESM2-35M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/ESM2-35M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="Synthyra/ESM2-35M", trust_remote_code=True)# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("Synthyra/ESM2-35M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -11,7 +11,12 @@ FastESM is a Huggingface compatible plug in version of ESM2 rewritten with a new
|
|
| 11 |
|
| 12 |
Load any ESM2 models into a FastEsm model to dramatically speed up training and inference without **ANY** cost in performance.
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
Various other optimizations also make the base implementation slightly different than the one in transformers.
|
| 16 |
|
| 17 |
## Use with 🤗 transformers
|
|
|
|
| 11 |
|
| 12 |
Load any ESM2 models into a FastEsm model to dramatically speed up training and inference without **ANY** cost in performance.
|
| 13 |
|
| 14 |
+
## Attention backend defaults
|
| 15 |
+
Flex Attention with a block mask that ignores pad tokens is the default attention backend. If Flex Attention is unavailable, FastESM falls back to native PyTorch attention.
|
| 16 |
+
|
| 17 |
+
For throughput and memory efficiency, `torch.compile(...)` is heavily recommended, especially when using Flex Attention.
|
| 18 |
+
|
| 19 |
+
Outputting attention maps (or the contact prediction head) is not natively possible with the optimized attention backends (including Flex Attention). You can still pass ```output_attentions``` to have attention calculated manually and returned.
|
| 20 |
Various other optimizations also make the base implementation slightly different than the one in transformers.
|
| 21 |
|
| 22 |
## Use with 🤗 transformers
|