11export CUDA_VISIBLE_DEVICES=$1
22
3+ # 动态获取GPU数
4+ OLD_IFS=" $IFS "
5+ IFS=" ,"
6+ arr=($1 )
7+ IFS=" $OLD_IFS "
8+
39if [ ! -f ./MUGE_MR_train_base64_part.tsv ]; then
410 wget https://atp-modelzoo-sh.oss-cn-shanghai.aliyuncs.com/release/tutorials/CLIP/MUGE_MR_train_base64_part.tsv
511fi
@@ -21,7 +27,7 @@ mode=$2
2127if [ " $mode " = " train" ]; then
2228 easynlp \
2329 --mode $mode \
24- --worker_gpu=1 \
30+ --worker_gpu=${ # arr[@]} \
2531 --tables=./MUGE_MR_train_base64_part.tsv,./MUGE_MR_valid_base64_part.tsv \
2632 --input_schema=text:str:1,image:str:1 \
2733 --first_sequence=text \
@@ -41,7 +47,7 @@ if [ "$mode" = "train" ]; then
4147elif [ " $mode " = " evaluate" ]; then
4248 easynlp \
4349 --mode $mode \
44- --worker_gpu=1 \
50+ --worker_gpu=${ # arr[@]} \
4551 --tables=./MUGE_MR_valid_base64_part.tsv \
4652 --input_schema=text:str:1,image:str:1 \
4753 --first_sequence=text \
@@ -57,7 +63,7 @@ elif [ "$mode" = "evaluate" ]; then
5763elif [ " $mode " = " predict" ]; then
5864 easynlp \
5965 --mode $mode \
60- --worker_gpu=1 \
66+ --worker_gpu=${ # arr[@]} \
6167 --tables=./MUGE_MR_test_base64_part_text.tsv \
6268 --input_schema=text:str:1 \
6369 --output_schema=text_feat \
@@ -74,7 +80,7 @@ elif [ "$mode" = "predict" ]; then
7480# elif [ "$mode" = "predict" ]; then
7581# easynlp \
7682# --mode $mode \
77- # --worker_gpu=1 \
83+ # --worker_gpu=${#arr[@]} \
7884# --tables=./MUGE_MR_test_base64_part_image.tsv \
7985# --input_schema=image:str:1 \
8086# --output_schema=image_feat \
0 commit comments