Instructions to use Synthyra/ESM2-650M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/ESM2-650M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="Synthyra/ESM2-650M", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("Synthyra/ESM2-650M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download fastplms/features/__init__.py from Synthyra/ESM2-650M: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/Synthyra/ESM2-650M/resolve/main/fastplms/features/__init__.py
- Command line
-
hf download hf://Synthyra/ESM2-650M/fastplms/features/__init__.py
-
curl -L -o __init__.py https://huggingface.co/Synthyra/ESM2-650M/resolve/main/fastplms/features/__init__.py
1.92 kB
| """The FastPLMs feature store: one storage format for every embedding this workspace keeps. | |
| A feature is one value per sequence, addressed by the SHA-256 of the sequence and by a key that | |
| names the model, its revision, the sparse autoencoder, the layer, the pooling, the dtype, and the | |
| residue limit. `store` holds the directory format and `layouts` the row layouts: dense vectors, | |
| compressed-sparse pooled rows, ragged hidden states, and ragged top-k residue codes. `reader` | |
| serves rows by random access to loops that read a batch at a time, `writing` commits a window of | |
| rows as one segment, and `conversion` moves a cache another format holds into a store and proves the | |
| rows survived. | |
| """ | |
| from .async_writer import AsyncFeatureWriter, PackedBatch | |
| from .conversion import ( | |
| ConversionMismatch, | |
| ConversionReceipt, | |
| conversion_fingerprint, | |
| convert_rows, | |
| describe_file, | |
| ) | |
| from .layouts import ( | |
| CSR, | |
| DENSE, | |
| LAYOUT_NAMES, | |
| RAGGED, | |
| RAGGED_TOPK, | |
| SparseRow, | |
| TopKRow, | |
| dtype_name, | |
| value_dtype, | |
| ) | |
| from .reader import CsrRows, FeatureReader | |
| from .store import ( | |
| FORMAT, | |
| FeatureStore, | |
| RowAddress, | |
| SegmentReceipt, | |
| SegmentWriter, | |
| StoredFeature, | |
| features_in, | |
| open_feature, | |
| partition_sequences, | |
| sequence_digest, | |
| ) | |
| from .writing import write_rows | |
| __all__ = [ | |
| "CSR", | |
| "DENSE", | |
| "FORMAT", | |
| "LAYOUT_NAMES", | |
| "RAGGED", | |
| "RAGGED_TOPK", | |
| "AsyncFeatureWriter", | |
| "ConversionMismatch", | |
| "ConversionReceipt", | |
| "CsrRows", | |
| "FeatureReader", | |
| "FeatureStore", | |
| "PackedBatch", | |
| "RowAddress", | |
| "SegmentReceipt", | |
| "SegmentWriter", | |
| "SparseRow", | |
| "StoredFeature", | |
| "TopKRow", | |
| "conversion_fingerprint", | |
| "convert_rows", | |
| "describe_file", | |
| "dtype_name", | |
| "features_in", | |
| "open_feature", | |
| "partition_sequences", | |
| "sequence_digest", | |
| "value_dtype", | |
| "write_rows", | |
| ] | |