Trimming vocabulary of pre-trained multilingual language models to language localization.
Project description
LM-Vocab-Trimmer: A Simple Model Compression by Trimming Embedding Matrix
The LM-Vocab-Trimmer a.k.a. vocabtrimmer
is a model compression tool aiming at reducing the parameter size of multilingual LMs
by trimming unused tokens from the embedding matrix.
This library assumes that you want to use or already fine-tuned a multilingual LM in a few specific languages,
and other languages are not needed to be covered by the LM anymore.
Then, vocabtrimmer
remove those tokens in the out-of-scope languages from the embedding matrix,
the input and the output embedding matrix .
Multilingual LMs (mT5, mBART, XLM-R, etc) are
is a pythob
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.