Unverified Commit 00cad2e5 authored by PaulLerner's avatar PaulLerner Committed by GitHub
Browse files

fix: #10628 expanduser path in TrainingArguments (#10660)



* fix: #10628 expanduser path in TrainingArguments

* docs: explain why we expand paths in TrainingArguments

* Style
Co-authored-by: default avatarSylvain Gugger <sylvain.gugger@gmail.com>
parent e8246f78
......@@ -507,6 +507,14 @@ class TrainingArguments:
_n_gpu: int = field(init=False, repr=False, default=-1)
def __post_init__(self):
# expand paths, if not os.makedirs("~/bar") will make directory
# in the current directory instead of the actual home
#  see https://github.com/huggingface/transformers/issues/10628
if self.output_dir is not None:
self.output_dir = os.path.expanduser(self.output_dir)
if self.logging_dir is not None:
self.logging_dir = os.path.expanduser(self.logging_dir)
if self.disable_tqdm is None:
self.disable_tqdm = logger.getEffectiveLevel() > logging.WARN
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment