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
Conflicted version of "protobuf" in "ray" and "BertForSequenceClassification"
Thank you for your great work in geneformer and patient answer in my last question!
For "from transformers import BertForSequenceClassification":
"RuntimeError: Failed to import transformers.models.bert.modeling_bert because of the following error (look up to see its traceback):
cannot import name 'builder' from 'google.protobuf.internal'"for "import ray":
"Downgrade the protobuf package to 3.20.x or lower."
I found a lower version of "protobuf" is required for "ray", but a higher version of "protobuf" is required for "BertForSequenceClassification". How can I combine two of them? Besides, what's the python version you used?
Hi! I suggest creating a conda env: https://conda.io/projects/conda/en/latest/user-guide/install/index.html (Python 3.10.12). You can then install ray through the PyPi channel with !pip install ray and !pip install ray[tune]. This installation will set Ray to 2.6.1/2.6.X. Package dependencies are easily resolved using conda/mamba when setting up Python environments.
- Madhavan