"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "7853bfbed7310f7d46379e3cd0415002cf5e3eb8"
Commit 0d636744 authored by lematt1991's avatar lematt1991 Committed by Facebook Github Bot
Browse files

Fixing xlm example docts (#776)

Summary:
Resolves #762
Pull Request resolved: https://github.com/pytorch/fairseq/pull/776

Differential Revision: D15631503

Pulled By: lematt1991

fbshipit-source-id: 103f77d553476917b8b0f8001767217fb311d920
parent b1dd40cf
...@@ -18,9 +18,10 @@ Let's assume the following for the code snippets in later sections to work ...@@ -18,9 +18,10 @@ Let's assume the following for the code snippets in later sections to work
Pre-process and binarize the data with the MaskedLMDictionary and cross_lingual_lm task Pre-process and binarize the data with the MaskedLMDictionary and cross_lingual_lm task
``` ```bash
# Ensure the output directory exists # Ensure the output directory exists
mkdir -p monolingual_data/fairseq_processed DATA_DIR=monolingual_data/fairseq_processed
mkdir -p "$DATA_DIR"
for lg in ar de en hi fr for lg in ar de en hi fr
do do
...@@ -41,8 +42,8 @@ do ...@@ -41,8 +42,8 @@ do
for stage in train test valid for stage in train test valid
sudo mv $stage.$lg-None.$lg.bin $stage.$lg.bin sudo mv "$DATA_DIR/$stage.$lg-None.$lg.bin" "$stage.$lg.bin"
sudo mv $stage.$lg-None.$lg.idx $stage.$lg.idx sudo mv "$DATA_DIR/$stage.$lg-None.$lg.idx" "$stage.$lg.idx"
done done
...@@ -55,7 +56,7 @@ Use the following command to train the model on 5 languages. ...@@ -55,7 +56,7 @@ Use the following command to train the model on 5 languages.
``` ```
fairseq-train \ fairseq-train \
--task cross_lingual_lm monolingual_data/processed \ --task cross_lingual_lm monolingual_data/fairseq_processed \
--save-dir checkpoints/mlm \ --save-dir checkpoints/mlm \
--max-update 2400000 --save-interval 1 --no-epoch-checkpoints \ --max-update 2400000 --save-interval 1 --no-epoch-checkpoints \
--arch xlm_base \ --arch xlm_base \
...@@ -63,8 +64,8 @@ fairseq-train \ ...@@ -63,8 +64,8 @@ fairseq-train \
--lr-shrink 0.5 --lr 0.0001 --min-lr 1e-09 \ --lr-shrink 0.5 --lr 0.0001 --min-lr 1e-09 \
--dropout 0.1 \ --dropout 0.1 \
--criterion masked_lm_loss \ --criterion masked_lm_loss \
--max-tokens 2048 --tokens-per-sample 256 --no-bias-kv --attention-dropout 0.1 \ --max-tokens 2048 --tokens-per-sample 256 --attention-dropout 0.1 \
--lazy-load --seed 0 \ --dataset-impl lazy --seed 0 \
--masked-lm-only \ --masked-lm-only \
--monolingual-langs 'ar,de,en,hi,fr' --num-segment 5 \ --monolingual-langs 'ar,de,en,hi,fr' --num-segment 5 \
--ddp-backend=no_c10d --ddp-backend=no_c10d
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment