This repo shows how to convert a fairseq NLLB-MoE model to transformers and run a forward pass
As the
fairseq
repository is not really optimised to run inference out-of-the-box, make sure you have a very very big CPU/GPU RAM.
Around 600 GB are required to run an inference with the
fairseq
model, as you need to load the checkpoints (~300GB) then build the model (~300GB again), then finally you can load the checkpoints in the model.
0. Download the original checkpoints:
The checkpoints in this repository were obtained using the following command (ased on the instructions given on the fairseq repository):
wget --trust-remote-name path_to_nllb
tar -cf model.tar.zf
3. Clone this repo (click top right on "How to clone")
4. Run the inference script:
Convert the checkpoints on the fly using the conversion script.
transformers
is required to do this:
cd <path/to/cloned/repo>
python3 /home/arthur_huggingface_co/fairseq/weights/checkpoints/convert_nllb_moe_sharded_original_checkpoint_to_pytorch.py --pytorch_dump_folder_path <dump_folder> --nllb_moe_checkpoint_path <nllb_checkpoint_path>
4. Run the inference script:
cd <path/to/cloned/repo>
bash run.sh
Runs of ArthurZ fairseq-nllb-moe on huggingface.co
0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About fairseq-nllb-moe huggingface.co Model
fairseq-nllb-moe huggingface.co
fairseq-nllb-moe huggingface.co is an AI model on huggingface.co that provides fairseq-nllb-moe's model effect (), which can be used instantly with this ArthurZ fairseq-nllb-moe model. huggingface.co supports a free trial of the fairseq-nllb-moe model, and also provides paid use of the fairseq-nllb-moe. Support call fairseq-nllb-moe model through api, including Node.js, Python, http.
fairseq-nllb-moe huggingface.co is an online trial and call api platform, which integrates fairseq-nllb-moe's modeling effects, including api services, and provides a free online trial of fairseq-nllb-moe, you can try fairseq-nllb-moe online for free by clicking the link below.
ArthurZ fairseq-nllb-moe online free url in huggingface.co:
fairseq-nllb-moe is an open source model from GitHub that offers a free installation service, and any user can find fairseq-nllb-moe on GitHub to install. At the same time, huggingface.co provides the effect of fairseq-nllb-moe install, users can directly use fairseq-nllb-moe installed effect in huggingface.co for debugging and trial. It also supports api for free installation.