MAGICS-LAB / DNABERT_2

[ICLR 2024] DNABERT-2: Efficient Foundation Model and Benchmark for Multi-Species Genome
Apache License 2.0
212 stars 49 forks source link

ValueError: The model class you are passing has a `config_class` attribute that is not consistent with the config class you passed #55

Closed rohan-sonthalia closed 8 months ago

rohan-sonthalia commented 8 months ago

I get the following error when I try to use the pre-trained DNABERT-2 on hugging face, through the transformers package

ValueError: The model class you are passing has aconfig_classattribute that is not consistent with the config class you passed (model has <class 'transformers.models.bert.configuration_bert.BertConfig'> and you passed <class 'transformers_modules.zhihan1996.DNABERT-2-117M.1d020b803b871a976f5f3d5565f0eac8f2c7bb81.configuration_bert.BertConfig'>. Fix one of those so they match!

colobas commented 7 months ago

Can you share how you addressed this?

rohan-sonthalia commented 7 months ago

make sure you use transformers==4.29.0. In my case that solved the error.