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
-
Update geneformer/perturber_utils.py
Verified signature566111f
-
edit imports in perturber_utils
Christina Theodorisc6d04a6
-
fix exact_mean subselection to be for index rather than col name
Christina Theodorisa13a2cf -
fix exact_mean and exact_median to subselect dataframe emb cols, not cell rows
Christina Theodoriscfc8cdb -
add quantization for pretrained model
Christina Theodoris7b591f6
-
Prepare data cell level pass cell state dict instead of genes (#483)
Verified signature- Update geneformer/classifier.py (107b2b84dd2a79cdba7470322d6c3637cc1d41ed) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>69e6887 -
ensure gene class dict only inverted when using gene classifier
Christina Theodoris54b408b
-
make plot roc compatible with eval-only metrics
Christina Theodorisae4867d -
Merge remote-tracking branch 'origin/main'
Christina Theodoris5760b30 -
fix gene class dict labeling
Christina Theodorisbfcada4
-
Fix how mappings and train and val data are returned (#473)
Verified signature- Update geneformer/mtl/data.py (cbf98f9a9115ccfe374a081b8758653d83f797b3) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>c81f6f9
-
Upload gene_name_id_dict_gc95M.pkl (#470)
Verified signature- Upload gene_name_id_dict_gc95M.pkl (db37c3e4de75ff21a48777e1be9bf8a0445c812b) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>01d3ea8
-
Add checks for custom attributes and n_counts prior to sum ensembl id (#461)
Verified signature- Add checks for custom attributes and n_counts prior to sum ensembl id (da2aaeac0a4a7102f6433dd6345ebfb31e6a36c8) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>09de197 -
further emphasize different token dictionaries in examples
Christina Theodorise2ee685 -
remove unused imports while no longer using distributed sampler
Verified signatureb9028ba -
Raise error for train and validation mismatch (#459)
Verified signature- Raise error for train and validation mismatch (83f83fdbee9d0e9c19e2f050181f8bcb7b1ac8b3) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>9af94b8
-
Upload in_silico_perturber.py (#432)
Verified signature- Upload in_silico_perturber.py (9f0fa5d773efa20d201f2d548baff6edca7d08d5) Co-authored-by: David Wen <davidjwen@users.noreply.huggingface.co>cb89107
-
Update geneformer/emb_extractor.py (#453)
Verified signature- Update geneformer/emb_extractor.py (2c8d3f5d8ebb362ad102cb7e924d84a39b7349c8) - Update geneformer/emb_extractor.py (62074538699215f6f0f8aca01d2e8f974386d800) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>ebc1e09 -
Update geneformer/tokenizer.py (#450)
Verified signature- Update geneformer/tokenizer.py (889cadcf135b313171aadec4e879caae20fd0bc1) - Update geneformer/tokenizer.py (b8808792d6e106aeec320447f4032b49533ba4de) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>664f71e
-
update isp default mode to cls
Verified signature0c99403
-
Adding tags to the model (#448)
Verified signature- Adding tags to the model (be2d2266582f7a1c47f73d999296d823ea14bc2e) Co-authored-by: Can Ergen <canergen@users.noreply.huggingface.co>3a68669
-
update transformers version to match pretrainer using accelerate
Verified signature3d62bb9 -
update pretrainer to not use distributed sampler (Trainer uses accelerate)
Verified signature8140c51
-
update function for N_Detections for mixture_model without anchor_token
Christina Theodorisdf297bc
-
add check to ensure emb_label is None for getting state embs dict
Christina Theodoris39b4444
-
change default emb to cls
Verified signature9ee140a
-
include install time in model card
Verified signature21d36cd
-
Update trainer output dir (#427)
Verified signature- Update trainer output dir (414cf94616fe848b0d773ec954db7fd83723e2e2) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>dc23c5f
-
Update geneformer/tokenizer.py (#415)
Verified signature- Update geneformer/tokenizer.py (be7ceb5f505d41eb4d0eaf019096b63992f19909) - Update geneformer/tokenizer.py (6cfc5c452a15390d0364b5e8ca16fb4266bbaa58) - Upload ensembl_mapping_dict_gc30M.pkl (4cdb505ba17393dbb90a47b3cbce06dc891d6b0e) - Update geneformer/tokenizer.py (704ef0ded88e4ce7a82c298ff893bba8400f5ed7) - Update geneformer/tokenizer.py (cf2a3b5acc1f8cb6e1ca634c42fad7b8df31e60e) Co-authored-by: Han Chen <hchen725@users.noreply.huggingface.co>63275a8 -
Create multi-task_cell_classification.ipynb (#418)
Verified signature- Create multi-task_cell_classification.ipynb (a2d284f77702bc62fc4c226e2d5cf282ef7fea9f) - replace notebook format (abafc19e2ba4e6c9b9c53faf0268eea387d936a7) - update mtl cell classification notebook format (dc90822f2c1770b370adb49111d5f49d30850ce7) - delete notebook with problematic formatting (ae4e0e0ea1c565821928284a74e0648bff051d33) - Delete prior nb (40624e87b838652e60022e79eadfa72997315446) - Rename mtl example nb (628247599bf5f5aa2de011b9fd982e137059ef52) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>b138ba5
-
CUDA kernels incompatible with standard PyTorch device movement with 4bit/8bit, necessitating device-specific handling (#416)
Verified signature- CUDA kernels incompatible with standard PyTorch device movement with 4bit/8bit, necessitating device-specific handling (2d782dddfb391028edb514df03ffcaa4eea61f86) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>b6d28c3
-
Add find_packages to automatically include mtl and subpackages in setup.py (#410)
Verified signature- Add find_packages to automatically include mtl and subpackages in setup.py (72823c2a24c15c49f1021b85f6462aca5c405aa0) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>3b78204 -
adding tensorboard to setup.py (#409)
Verified signature- adding tensorboard to setup.py (056061996712aa9a0c4f1ab136b72a696735ccf8) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>94d98d1 -
tensorboard add to reqs (#407)
Verified signature- tensorboard add to reqs (662af56a0682675766496148db3a5f48bf113c3b) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>e8fa43a
-
dictionaries from parent dir (#405)
Verified signature- dictionaries form parent dir (713240f3833d3547237ba53fe2c7e09bfc04e5f0) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>85f295e -
remove token dictionary and unpickling from init (#403)
Verified signature- nested import for dictionaries from parent (3b4533faff40ad00e85ec014cae258b31cdd2647) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>7eca269
-
move dict loading to function in eval utils
57bc17e -
edit doc formatting
fce3f6e -
edit docs formatting
ef094b2 -
add mtl_classifier to docs
bedb3b7 -
add input size tip to instructions
Verified signature2732369 -
update tokenizer to defaults for 95M models for special token and input size
Verified signatureda8cf3d -
update instructions to include reminder about token dictionary
Verified signaturecb1b0d5
-
pointing dictionaries from the mtl module's init (#397)
Verified signature- pointing dictionaries from the mtl module's init (5539d14469f84e2f0b13a7cb3f6054b2b0cbf1f3) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>7470753 -
Refactored token dictionary loading and encapsulated dictionary (#398)
Verified signature- Refactored token dictionary loading and encapsulated dictionary (fad91b8ccc1ad2931ed53fcb30902a04f6f30f90) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>beb62a4 -
Refactor: Convert mask_token_id, pad_token_id, and all_special_ids to properties (#395)
Verified signature- Refactor: Convert mask_token_id, pad_token_id, and all_special_ids to properties (02febb8c9cc71177ab74ab03ab83e597b7ec1df7) Co-authored-by: Madhavan Venkatesh <madhavanvenkatesh@users.noreply.huggingface.co>2e06f1a
-
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