Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TC test run to CI #195

Merged
merged 30 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reduce datasets
  • Loading branch information
eu9ene committed Sep 15, 2023
commit 0612e34e9eb4418d4fbe283c3541c7ab24cd944a
3 changes: 2 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ best_model_metric = config['experiment']['best-model']
best_model = f"final.model.npz.best-{best_model_metric}.npz"
backward_dir = f'{models_dir}/backward'
spm_sample_size=config['experiment']['spm-sample-size']
spm_vocab_size=config['experiment'].get('spm-vocab-size',"32000")
vocab_path=vocab_pretrained or f"{models_dir}/vocab/vocab.spm"

#evaluation
Expand Down Expand Up @@ -418,7 +419,7 @@ if not vocab_pretrained:
output: vocab_path
params: prefix_train=clean_corpus_prefix,prefix_test=f"{original}/devset"
shell: '''bash pipeline/train/spm-vocab.sh "{input.corpus_src}" "{input.corpus_trg}" "{output}" {spm_sample_size} \
>> {log} 2>&1'''
{threads} {spm_vocab_size} >> {log} 2>&1'''

if do_train_backward:
rule train_backward:
Expand Down
13 changes: 9 additions & 4 deletions configs/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ experiment:
mono-max-sentences-trg: 200000
split-length: 100000
spm-sample-size: 100000
spm_vocab_size: 4000

best-model: chrf

Expand All @@ -30,26 +31,31 @@ marian-args:
save-freq: 100
valid-freq: 100
after: 500u
dim-vocabs: [4000, 4000]
training-teacher-base:
disp-freq: 10
save-freq: 100
valid-freq: 100
after: 500u
dim-vocabs: [4000, 4000]
training-teacher-finetuned:
disp-freq: 10
save-freq: 100
valid-freq: 100
after: 500u
dim-vocabs: [4000, 4000]
training-student:
disp-freq: 10
save-freq: 100
valid-freq: 100
after: 500u
dim-vocabs: [4000, 4000]
training-student-finetuned:
disp-freq: 10
save-freq: 100
valid-freq: 100
after: 500u
dim-vocabs: [4000, 4000]
decoding-backward:
mini-batch-words: 2000
decoding-teacher:
Expand All @@ -59,17 +65,16 @@ marian-args:
datasets:
train:
- opus_ada83/v1
- opus_GNOME/v1
- mtdata_Neulab-tedtalks_train-1-eng-rus
- mtdata_ELRC-wikipedia_health-1-eng-rus
devtest:
- flores_dev
- sacrebleu_wmt19
test:
- flores_devtest
- sacrebleu_wmt20
mono-src:
- news-crawl_news.2020
- news-crawl_news.2007
mono-trg:
- news-crawl_news.2020
- news-crawl_news.2008


3 changes: 2 additions & 1 deletion pipeline/train/spm-vocab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ corpus_trg=$2
vocab_output=$3
sample_size=$4
threads=$5
vocab_size="${6:-32000}"

if [ "$threads" = "auto" ]; then
threads=$(nproc)
Expand All @@ -27,7 +28,7 @@ ${COMPRESSION_CMD} -dc "${corpus_src}" >"${vocab_dir}/data.src.txt"
${COMPRESSION_CMD} -dc "${corpus_trg}" >"${vocab_dir}/data.trg.txt"

"${MARIAN}/spm_train" --bos_id=-1 --eos_id=0 --unk_id=1 --user_defined_symbols="" \
--model_prefix="${vocab_dir}/vocab" --vocab_size=32000 \
--model_prefix="${vocab_dir}/vocab" --vocab_size="${vocab_size}" \
--input="${vocab_dir}/data.src.txt,${vocab_dir}/data.trg.txt" \
--input_sentence_size="${sample_size}" --shuffle_input_sentence=true \
--num_threads "${threads}"
Expand Down