Instructions to use ctheodoris/Geneformer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ctheodoris/Geneformer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="ctheodoris/Geneformer")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("ctheodoris/Geneformer") model = AutoModelForMaskedLM.from_pretrained("ctheodoris/Geneformer", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Christina Theodoris commited on
Commit ·
39b4444
1
Parent(s): 9ee140a
add check to ensure emb_label is None for getting state embs dict
Browse files
geneformer/emb_extractor.py
CHANGED
|
@@ -719,6 +719,12 @@ class EmbExtractor:
|
|
| 719 |
)
|
| 720 |
raise
|
| 721 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 722 |
state_embs_dict = dict()
|
| 723 |
state_key = cell_states_to_model["state_key"]
|
| 724 |
for k, v in cell_states_to_model.items():
|
|
|
|
| 719 |
)
|
| 720 |
raise
|
| 721 |
|
| 722 |
+
if self.emb_label is not None:
|
| 723 |
+
logger.error(
|
| 724 |
+
"For extracting state embs, emb_label should be None since labels are based on state embs dict keys."
|
| 725 |
+
)
|
| 726 |
+
raise
|
| 727 |
+
|
| 728 |
state_embs_dict = dict()
|
| 729 |
state_key = cell_states_to_model["state_key"]
|
| 730 |
for k, v in cell_states_to_model.items():
|