Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JunnYu authored and triple-Mu committed Aug 3, 2023
1 parent 3008797 commit 7131df6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions paddlenlp/trainer/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def _parse_dataclass_field(parser: ArgumentParser, field: dataclasses.Field):
kwargs["default"] = field.default
else:
kwargs["required"] = True
elif field.type is bool or field.type is Optional[bool]:
# fix https://github.com/huggingface/transformers/pull/16946
elif field.type is bool or field.type == Optional[bool]:
# Copy the currect kwargs to use to instantiate a `no_*` complement argument below.
# We do not initialize it here because the `no_*` alternative must be instantiated after the real argument
bool_kwargs = copy(kwargs)
Expand Down Expand Up @@ -148,7 +149,7 @@ def _parse_dataclass_field(parser: ArgumentParser, field: dataclasses.Field):
# Order is important for arguments with the same destination!
# We use a copy of earlier kwargs because the original kwargs have changed a lot before reaching down
# here and we do not need those changes/additional keys.
if field.default is True and (field.type is bool or field.type is Optional[bool]):
if field.default is True and (field.type is bool or field.type == Optional[bool]):
bool_kwargs["default"] = False
parser.add_argument(f"--no_{field.name}", action="store_false", dest=field.name, **bool_kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ null:null
null:null
##
trainer:norm_train
norm_train:../ppdiffusers/examples/text_to_image_laion400m/train_txt2img_laion400m_trainer.py --disable_tqdm True --benchmark True --overwrite_output_dir True --resolution 256 --do_train --output_dir ./outputs --learning_rate 5e-5 --weight_decay 0.02 --lr_scheduler_type "constant" --warmup_steps 0 --image_logging_steps -1 --logging_steps 10 --save_steps 999999 --seed 23 --dataloader_num_workers 8 --pretrained_model_name_or_path CompVis/ldm-text2im-large-256 --file_list ./data/filelist/train.filelist.list --model_max_length 77 --max_grad_norm -1 --fp16_opt_level O2
norm_train:./PaddleMIX/ppdiffusers/examples/text_to_image_laion400m/train_txt2img_laion400m_trainer.py --disable_tqdm True --benchmark True --overwrite_output_dir True --resolution 256 --do_train --output_dir ./outputs --learning_rate 5e-5 --weight_decay 0.02 --lr_scheduler_type "constant" --warmup_steps 0 --image_logging_steps -1 --logging_steps 10 --save_steps 999999 --seed 23 --dataloader_num_workers 8 --pretrained_model_name_or_path CompVis/ldm-text2im-large-256 --file_list ./data/filelist/train.filelist.list --model_max_length 77 --max_grad_norm -1 --fp16_opt_level O2
pact_train:null
fpgm_train:null
distill_train:null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ null:null
null:null
##
trainer:norm_train
norm_train:../ppdiffusers/examples/stable_diffusion/train_txt2img_laion400m_trainer.py --benchmark True --overwrite_output_dir True --resolution 256 --do_train --output_dir ./outputs --learning_rate 5e-5 --weight_decay 0.02 --lr_scheduler_type "constant" --warmup_steps 0 --image_logging_steps -1 --logging_steps 10 --save_steps 999999 --seed 23 --dataloader_num_workers 8 --pretrained_model_name_or_path CompVis/stable-diffusion-v1-4 --file_list ./data/filelist/train.filelist.list --model_max_length 77 --max_grad_norm -1 --fp16_opt_level O1
norm_train:./PaddleMIX/ppdiffusers/examples/stable_diffusion/train_txt2img_laion400m_trainer.py --benchmark True --overwrite_output_dir True --resolution 256 --do_train --output_dir ./outputs --learning_rate 5e-5 --weight_decay 0.02 --lr_scheduler_type "constant" --warmup_steps 0 --image_logging_steps -1 --logging_steps 10 --save_steps 999999 --seed 23 --dataloader_num_workers 8 --pretrained_model_name_or_path CompVis/stable-diffusion-v1-4 --file_list ./data/filelist/train.filelist.list --model_max_length 77 --max_grad_norm -1 --fp16_opt_level O1
pact_train:null
fpgm_train:null
distill_train:null
Expand Down
7 changes: 5 additions & 2 deletions tests/test_tipc/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ elif [ ${MODE} = "benchmark_train" ];then
python -m pip install -e ../
# python -m pip install paddlenlp # PDC 镜像中安装失败
python -m pip list
python -m pip install -e ../ppdiffusers

# install develop paddlemix/ppdiffusers
git clone https://github.com/PaddlePaddle/PaddleMIX.git
cd PaddleMIX
python -m pip install -e ./ppdiffusers
cd -
fi

0 comments on commit 7131df6

Please sign in to comment.