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") - Inference
- Notebooks
- Google Colab
- Kaggle
Setting max_ncells=None in EmbExtractor causes TypeError
Hi,
the documentation of EmbExtractor says:
max_ncells: None, int
Maximum number of cells to extract embeddings from.
Default is 1000 cells randomly sampled from input data.
If None, will extract embeddings from all cells.
But setting max_ncells=None to get all embeddings causes a TypeError:
Traceback (most recent call last):
File "/home/user/gf/src/plot_embeddings.py", line 49, in
args = parse_args()
File "/home/user/gf/src/plot_embeddings.py", line 42, in main
embs = embex.extract_embs(args.model_path,
File "/home/user/gf/src/geneformer/emb_extractor.py", line 840, in plot_embs
if max_ncells_to_plot > self.max_ncells:
TypeError: '>' not supported between instances of 'int' and 'NoneType'
Not sure if this is the right place to post, since huggingface has no issue section.
Thank you for pointing this out! We pushed a fix so please update.