mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 18:22:34 +06:00
* fix: #10628 expanduser path in TrainingArguments * docs: explain why we expand paths in TrainingArguments * Style Co-authored-by: Sylvain Gugger <sylvain.gugger@gmail.com>
This commit is contained in:
parent
e8246f78f9
commit
00cad2e5c1
@ -507,6 +507,14 @@ class TrainingArguments:
|
|||||||
_n_gpu: int = field(init=False, repr=False, default=-1)
|
_n_gpu: int = field(init=False, repr=False, default=-1)
|
||||||
|
|
||||||
def __post_init__(self):
|
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:
|
if self.disable_tqdm is None:
|
||||||
self.disable_tqdm = logger.getEffectiveLevel() > logging.WARN
|
self.disable_tqdm = logger.getEffectiveLevel() > logging.WARN
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user