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")# 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 ·
b36d210
1
Parent(s): bb217cf
Update internal format of anchor token to list for consistency with genes to perturb
Browse files
geneformer/in_silico_perturber.py
CHANGED
|
@@ -425,7 +425,7 @@ class InSilicoPerturber:
|
|
| 425 |
if anchor_gene is None:
|
| 426 |
self.anchor_token = None
|
| 427 |
else:
|
| 428 |
-
self.anchor_token = self.gene_token_dict[self.anchor_gene]
|
| 429 |
|
| 430 |
if genes_to_perturb == "all":
|
| 431 |
self.tokens_to_perturb = "all"
|
|
|
|
| 425 |
if anchor_gene is None:
|
| 426 |
self.anchor_token = None
|
| 427 |
else:
|
| 428 |
+
self.anchor_token = [self.gene_token_dict[self.anchor_gene]]
|
| 429 |
|
| 430 |
if genes_to_perturb == "all":
|
| 431 |
self.tokens_to_perturb = "all"
|