Commit 03ced14d by libei

revise the conver model script, now we use conver_t2t_to_fairseq.py to convert…

revise the conver model script,  now we use conver_t2t_to_fairseq.py to convert the t2t checkpoint into fairseq.pt
parent d3205fc9
#! /usr/bin/bash
set -e
# device, you can set multiple devices, e.g. device=(0 1 2)
# then program will parallelly translate over various evalset (e.g. evalset=(cwmt18-dev mt06 mt08), or over various alpha (e.g. alphas=(1.0 1.1 1.2).
# However, note that multiple evalset and multiple alpha can not set concurrently.
# more device will not be used. e.g. you set device=(0 1 2 3), but you only choose three evalset, the gpu=3 will not be used
device=(0 1 2 3 4 5 6 7)
# your model
model=dense_transformer
# your hparams
params=dense_transformer_base
# your tag, must set!
tag=dense16
model_dir=t2tmodel/$tag/ensemble15
output_dir=checkpoints/$tag
if [ ! -d "$output_dir" ]; then
mkdir -p $output_dir
fi
n_head=8
result=$(echo $params | sed -n '/base/'p)
if [[ "$result" != "" ]]; then
n_head=8
else
n_head=16
fi
echo "n_head=$n_head"
CUDA_VISIBLE_DEVICES=0 python3 scripts/convert_dense_to_fairseq.py -model $model_dir/ensemble_15-0 -src_vocab t2tmodel/source_dic -tgt_vocab t2tmodel/target_dic -head_num $n_head -vocab_output $model_dir/fairseq.vocab -model_output $output_dir/fairseq.pt
rm online.vocab
......@@ -6,10 +6,6 @@ set -e
# However, note that multiple evalset and multiple alpha can not set concurrently.
# more device will not be used. e.g. you set device=(0 1 2 3), but you only choose three evalset, the gpu=3 will not be used
device=(0 1 2 3 4 5 6 7)
# your model
model=transformer
# your hparams
params=transformer_big
# your tag, must set!
tag=big_v3_multistep4
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论