No Fine-Tune/ Bert_token_embedder module inside Allennlp commands or token_embedders

213 Views Asked by At

I have been working on a github project from here: https://github.com/jiacheng-xu/DiscoBERT According to the authors, it requires Allennlp 0.9.0. I created a virtual environment using pip and tried installing 0.9, but it gave an error. So, I tried Allennlp 1.2 which installed fine, but I am getting errors in the two following lines:

from allennlp.commands.fine_tune import fine_tune_model_from_file_paths
from allennlp.modules.token_embedders.bert_token_embedder import PretrainedBertModel, PretrainedBertEmbedder

It seems, in the 1.2 version at least, there is no fine_tune and bert_token_embedder module. Is there a quick way to get past these errors?

1

There are 1 best solutions below

0
On

From https://github.com/allenai/allennlp/issues/4849:

We removed the file_tune command. You can now create your model with the from_archive() constructor (either with code, or from the config file), and train that way.

bert_token_embedder has also gone away. We unified the support for huggingface models in the pretrained_transformer_* classes. So there is now a pretrained_transformer_tokenizer, pretrained_transformer_indexer and a pretrained_transformer_embedder. Before we had several slightly different ways of doing the same thing, and that seemed dangerously confusing.

Why did installing the old version fail though? There is no reason old versions wouldn't work.