Instructions to use zhihan1996/DNA_bert_6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zhihan1996/DNA_bert_6 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="zhihan1996/DNA_bert_6", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("zhihan1996/DNA_bert_6", trust_remote_code=True) model = AutoModelForMaskedLM.from_pretrained("zhihan1996/DNA_bert_6", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Model name 'zhihan1996/DNA_bert_6' was not found in model name list.
Hi I am trying to get this to work. I am new to this. Here is what I am seeing as an issue:
Traceback (most recent call last):
File "./DNA_tr_model_part1.py", line 20, in
tokenizer = AutoTokenizer.from_pretrained(model_name)
File "/dartfs-hpc/rc/home/k/f006fpk/tools/DNABERT/src/transformers/tokenization_auto.py", line 181, in from_pretrained
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)
File "/dartfs-hpc/rc/home/k/f006fpk/tools/DNABERT/src/transformers/configuration_auto.py", line 183, in from_pretrained
pretrained_model_name_or_path, pretrained_config_archive_map=ALL_PRETRAINED_CONFIG_ARCHIVE_MAP, **kwargs
File "/dartfs-hpc/rc/home/k/f006fpk/tools/DNABERT/src/transformers/configuration_utils.py", line 241, in get_config_dict
raise EnvironmentError(msg)
OSError: Model name 'zhihan1996/DNA_bert_6' was not found in model name list. We assumed 'https://s3.amazonaws.com/models.huggingface.co/bert/zhihan1996/DNA_bert_6/config.json' was a path, a model identifier, or url to a configuration file named config.json or a directory containing such a file but couldn't find any such file at this path or url.
Here is what I am trying:
from transformers import AutoModelForPreTraining, AutoTokenizer
model_name = "zhihan1996/DNA_bert_6"
Initialize the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForPreTraining.from_pretrained(model_name)
Any advice or help would be appreciated! Thank you
I have exactly the same issue, any help would be appreciated.
Thanks for the comments. It works now.