Instructions to use Synthyra/FastESM2_650 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/FastESM2_650 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="Synthyra/FastESM2_650", trust_remote_code=True)# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("Synthyra/FastESM2_650", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Upload modeling_fastesm.py with huggingface_hub
Browse files- modeling_fastesm.py +1 -2
modeling_fastesm.py
CHANGED
|
@@ -756,8 +756,7 @@ class EmbeddingMixin:
|
|
| 756 |
for seq, emb, mask in zip(seqs, embeddings, attention_mask):
|
| 757 |
if full_embeddings:
|
| 758 |
emb = emb[mask.bool()].reshape(-1, hidden_size)
|
| 759 |
-
c.execute("INSERT OR REPLACE INTO embeddings VALUES (?, ?)",
|
| 760 |
-
(seq, emb.cpu().numpy().tobytes()))
|
| 761 |
|
| 762 |
if (i + 1) % 100 == 0:
|
| 763 |
conn.commit()
|
|
|
|
| 756 |
for seq, emb, mask in zip(seqs, embeddings, attention_mask):
|
| 757 |
if full_embeddings:
|
| 758 |
emb = emb[mask.bool()].reshape(-1, hidden_size)
|
| 759 |
+
c.execute("INSERT OR REPLACE INTO embeddings VALUES (?, ?)", (seq, emb.cpu().numpy().tobytes()))
|
|
|
|
| 760 |
|
| 761 |
if (i + 1) % 100 == 0:
|
| 762 |
conn.commit()
|