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
Commit History
-
pointing dictionaries from the mtl module's init
Verified signaturecould possibly modify init from the geneformer (geneformer/__init__.py) to work with the geneformer/mtl/__init__.py5539d14
-
sync token_dictionary variable name w/ classifier
Verified signaturea021deb
-
update setup with req and manifest with updated filenames
a34fbc2
-
fix imports mtl/eval_utils
eab1878
-
allow model_type valid options to take params model_type : {"Pretrained", "GeneClassifier", "CellClassifier", "MTLCellClassifier", "MTLCellClassifier-Quantized"} (#390)
Verified signature- allow model_type valid options to take params model_type : {"Pretrained", "GeneClassifier", "CellClassifier", "MTLCellClassifier", "MTLCellClassifier-Quantized"} (f8687d834ba074caf734cf29424902e42a8a8b18) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>47e0ef8 -
peft>=0.11.1 (#387)
Verified signature- peft>=0.11.1 (ddcaee0389760fa3dd12e6003dc1664b59a4eadc) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>4c9dda5 -
"save_model_without_heads" is redundant (#385)
Verified signature- "save_model_without_heads" is redundant (e384cc651481232513ac8ebd1fd2169f184e6a19) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>de10ab0 -
comment out "def save_model_without_heads(original_model_save_directory)"; redundant for ISP/Emb extractor (#382)
Verified signature- comment out "def save_model_without_heads(original_model_save_directory)"; redundant for ISP/Emb extractor (0a4e8a4ba076513934876cf83b1d3e727c26d46e) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>22bf20f -
fixed bug related to dynamic ranges in dictionary with 'min' and 'max' value mismatch in optuna suggest fn (#380)
Verified signature- fixed bug related to dynamic ranges in dictionary with 'min' and 'max' value mismatch in optuna suggest fn (76101b4cbc824eb4b61f8c3985f9652ba413d516) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>fe1640b
-
Update README.md
Verified signature11bcee7
-
precommit formatting
f07bfd7 -
update with 12L and 20L i4096 gc95M models, multitask and quantiz code
933ca80
-
rename for consistency
Verified signatureec19834 -
delete old gene name dict
Verified signature817eca2 -
update to only have gene names as keys in gene_name_id_dict
Verified signaturee61485e -
Add function for summing of Ensembl IDs (#377)
Verified signature- Add function for summing of Ensembl IDs (fb901a02a4aea5582603c2c3bf21d992b8a4f3b5) - Add init for ensembl mapping dict (43b42906ba1e5b16d2a71deb6881c4779007a24d) - Upload ensembl_mapping_dict_gc95M.pickle (47341ab1ee7a6d195a1a2527af51a0dc3abd0090) - Update geneformer/tokenizer.py (5197a60707457a72cf3c6f663e3eae65fc276831) - Filter gene mapping dict for items that exist in gene_token_dict (1e8d481b099f532afa8b9edf1f544d838edfea2f) - Update geneformer/tokenizer.py (b8b87fd14eec11e8e21105d30098c50496ae2ba5) - Upload ensembl_mapping_dict.pkl (e86dc76200df4aa1b02149d4d64254b92a0816d1) - Update geneformer/__init__.py (ad4b8e0c046cf6f51cb71573b04efa851923e4b6) - Upload 2 files (c9ba1f736b47384d602d714d49c1bdee21ae8bac) - Delete ensembl_mapping_dict.pkl (c5cea51562669bba7b068a12ca13510b865e7aff) - Upload 4 files (05bffd62fd51f24efcbb7d8db5eacabb976d7c95) - Delete geneformer/ensembl_mapping_dict_gc95M.pickle (004f5b40c72722df27d77991b6078510b15a0bd1) - Update .gitattributes (e91adac093c1667d6…1e18102
-
save pval
b07f4b1 -
add typing list import
42053dc
-
move dicts to init
ea428cb -
add random state to umap
eb2a04b
-
update get_embs with token_gene_dict arg
Verified signatureace12e9 -
update refs to get_model_emb_dims
Verified signature3fe35ba
-
embs_df with all model embeddings (#363)
Verified signature- embs_df with all model embeddings (9026cc190f358b9be7181ddb2d1368904e3393e1) - incorporate prior changes (8e35e450dafc6f1b57fd1f0fb73f99e127c1e088) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>2e64874 -
Add function to get number of model embeddings (#364)
Verified signature- Add function to get number of model embeddings (01313fd5b2416d697ae4d21db9f1ec80c91ab8bc) - extract emb_dims and input_size from config (89fc737b00596ae9b4f226da087e872022bf5a26) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>c90d791
-
clone embs_i to resolve memory leak in cls embs
57f02a4
-
update perturber stats to reflect cos sim and emb_extractor to suppress warnings for non-cls
25dd1da
-
update to account for set of perturbed genes with aggregate_data
eb038a6
-
update to enable cls emb
b2bbd7c
-
update tokenizer to include eos token
Christina Theodorisead0550
-
Update geneformer/emb_extractor.py (#350)
Verified signature- Update geneformer/emb_extractor.py (4c0377bf6093d5170cf0a7fc1921a2d7456b8883) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>471eefc
-
Upload in_silico_perturber_stats.py (#313)
Verified signature- Upload in_silico_perturber_stats.py (bde1f23f2712777472216e49c30b21cdcb4543ee) Co-authored-by: David Wen <davidjwen@users.noreply.huggingface.co>8aee0ff -
fix cell state gene embeddings bug (#345)
Verified signature- added quality of life improvements; fixed gene similarities with cell_states_to_model (4b4547f0634eed07560e599766c30326138b7a32) - reinstate save_to_disk patch (344f263c6173a6bbe96eabcc5ac65e45fa4756e7)c0e7b19
-
patch datasets save_to_disk
Christina Theodoris75c67a1
-
update kwargs for pretrainer
Christina Theodorisfb130e6
-
refer to token dictionary in self
Christina Theodoris86fe0dd
-
Update for gene classification (#330)
Verified signature- Update for gene classification (f49922d12ee1fe946a511e6d96b9cda14ce7c22b) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>94095d1 -
Update with gene classifier, custom token dict, and str validate options (#329)
Verified signature- Update with gene classifier, custom token dict, and str validate options (ae834bc2564a49ee071390284a726b13aa2b297f) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>0568479
-
add option for hyperparameter tuning to cc.validate
Christina Theodoris4bddd45
-
correct typo
Verified signature5a43832
-
update examples for predict_eval and handle roc for 2 cell classes
Christina Theodoriseeba323
-
Update readthedocs for classifier
Christina Theodorisf75f5ac
-
Get the gene keys and gene list keys from the token dictionary instead of medians (#304)
Verified signature- Get the gene keys and gene list keys from the token dictionary instead of medians (faab0d7678ab0347fae033a620c388ca970b59e0) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>b294421 -
Prevent ruff/isort on init
Christina Theodoris941390d -
Add classifier module and examples
Christina Theodoris9e9cca9
-
Update geneformer/emb_extractor.py (#303)
Verified signature- Update geneformer/emb_extractor.py (d1f49b5321b8f1b9709ddd6b27a577f6acc0ddeb) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>d6c634c
-
Fix typo (#301)
Verified signature- Fix typo (d1bbf272387475f1c413cca8679150549abd8bed) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>075bd53
-
Add option for variable input_size and to add CLS/SEP Tokens (#299)
Verified signature- Add option for variable input_size and to add CLS/SEP Tokens (944c98c4ed4fa9bd539c2a7d8db5351161d85012) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>aa25cd2
-
add load model for train and fix validate anchor gene error
Christina Theodoris0d675a3
-
Handle case of single gene del for isp modeling of gene embs
Christina Theodoris316d817
-
edit docstring format to highlight options
Christina Theodorise3330a6