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
Had a question to which head is the embedding extraction happening from in MTL
Hey there. Thanks so much for your contribution and active support!
Had a question as to which head the embedding extraction was happening in MTL ?
And do the options in EmbExtractor make a difference?
The options for emb_label: {"Pretrained", "GeneClassifier", "CellClassifier"}
Thank you for your questions! We generally extract embeddings from the last layer of the model prior to the heads, which should encode aspects of all the tasks represented in the MTL training. The options for the model_type relate to how the model is loaded. For example, if you use the pretrained model directly, it's best to select "Pretrained". Otherwise, a randomly initialized head will be added to the top of the model if loaded as "CellClassifier" let's say, so embeddings extracted from the head would be random.