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
fix: incorrect condition control flow
#261
by tpob - opened
this addresses the issue when using GeneformerPrecollator if not using numpy array as tensor backend, a ValueError is raise like type of tensor([ 2943, 24469, 12039, ..., 4506, 13856, 10511]) unknown: <class 'torch.Tensor'>. Should be one of a python, numpy, pytorch or tensorflow object.. I believe this is a bug, as I am clearly using a pytorch tensor. And in huggingface transformers library, similar code wrote here
ctheodoris changed pull request status to merged
Thank you for the fix!