transformers icon indicating copy to clipboard operation
transformers copied to clipboard

fix type annotations for arguments in training_args

Open shauray8 opened this issue 2 years ago • 3 comments

What does this PR do?

Fixes #24538 which is basically fixing type annotations for fsdp, fsdp_config, and sharded_ddp in training_args.py

Who can review?

maybe @sgugger

shauray8 avatar Jun 28 '23 13:06 shauray8

Fixing CI errors!

shauray8 avatar Jun 28 '23 14:06 shauray8

The documentation is not available anymore as the PR was closed or merged.

@sgugger I don't particularly understand why this error occurs in examples_flax - argparse.ArgumentError: argument --sharded_ddp: invalid typing.Union[str, bool, typing.List[transformers.trainer_utils.ShardedDDPOption], NoneType] value: ''

shauray8 avatar Jun 29 '23 13:06 shauray8

@sgugger bool breaks --sharded_ddp, I think we can still maintain Boolean arguments with string itself and https://github.com/huggingface/transformers/blob/20d6b84613984f2497587a62774704882ccbeee6/src/transformers/hf_argparser.py#L168-L173 with this --sharded_ddp and --fsdp defaults to string

shauray8 avatar Jul 10 '23 11:07 shauray8

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.