cisnlp / simalign

Obtain Word Alignments using Pretrained Language Models (e.g., mBERT)
MIT License
345 stars 47 forks source link

How to init simalign with local model files? #27

Closed maohbao closed 2 years ago

maohbao commented 2 years ago

Hi Jalili Sabet etc,

When I run simalign for the first time, it will download certain model files for several minutes, then give the info below:

"simalign.simalign - INFO - Initialized the EmbeddingLoader with model: bert-base-multilingual-cased"

My question is, can I download those model files beforehand and load it from my local disk when init simalign? And how to do this?

Thank you very much!

Bao

pdufter commented 2 years ago

Hi @maohbao thanks for your question. It should work to simply pass a path to the local model checkpoint in the "model" keyword, i.e., instead of "bert-base-multilingual-cased" pass a path to the local model checkpoint. Let us know if there are problems.