Closed lfoppiano closed 9 months ago
After several experiments and failures, I think this PR might not be a good choice to be integrated in DeLFT as it could lead to unpredictable behaviours (e.g. do_lower_case=True in the output configuration).
Nevertheless, I find quite difficult to convert a model configuration (including the tokenizer configuration) from tensorflow to a workable huggingface format and I haven't found any useful documentation for that.
This PR is to try to implement a way to load TF checkpoints and torch models in a "plain" way, so having just the
ckpt files
/pytorch_model.bin
and thevocab.txt
.I use this for loading pre-trained BERT/SciBERT embeddings using the original implementation with delft 0.3.0.
I've used
BertTokenizerFast
for the tokenizer. For the models I tried to guess whether it's Pytorch or TF based on the model name.