Instructions to use songlab/gpn-brassicales with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use songlab/gpn-brassicales with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="songlab/gpn-brassicales")# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("songlab/gpn-brassicales", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
KeyError when instantiating AutoModel.from_pretrained("songlab/gpn-brassicales")
When I try to instantiate a pre-trained AutoModel, I get the following key error. I don't think I had the error with the same code a few days ago. Does anyone know what the issue is? Thank you!
File "/projects/projectx/model/model.py", line 29, in init
self.gpn_model = AutoModel.from_pretrained("songlab/gpn-brassicales")
File "/userx/mambaforge/projectx/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 456, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
File "/userx/mambaforge/projectx/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 957, in from_pretrained
config_class = CONFIG_MAPPING[config_dict["model_type"]]
File "/userx/mambaforge/projectx/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 671, in getitem
raise KeyError(key)
KeyError: 'ConvNet'
Hi! I suspect you need to first import gpn.model, which defines the ConvNet architecture.