From f0340eccf90a81462ca025ef21350bdb13f22b42 Mon Sep 17 00:00:00 2001 From: Erik Chan Date: Wed, 18 Sep 2019 13:42:11 -0700 Subject: [PATCH 1/2] Typo Typo --- examples/run_lm_finetuning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_lm_finetuning.py b/examples/run_lm_finetuning.py index 4d14fe7ebb5..dad9fab83fc 100644 --- a/examples/run_lm_finetuning.py +++ b/examples/run_lm_finetuning.py @@ -57,7 +57,7 @@ class TextDataset(Dataset): def __init__(self, tokenizer, file_path='train', block_size=512): assert os.path.isfile(file_path) directory, filename = os.path.split(file_path) - cached_features_file = os.path.join(directory, f'cached_lm_{block_size}_{filename}') + cached_features_file = os.path.join(directory, 'cached_lm_{block_size}_{filename}') if os.path.exists(cached_features_file): logger.info("Loading features from cached file %s", cached_features_file) From f7978f70ecadd3ac6e3072f72e9dcc8c01e187c8 Mon Sep 17 00:00:00 2001 From: thomwolf Date: Tue, 1 Oct 2019 18:45:38 -0400 Subject: [PATCH 2/2] use format instead of f-strings --- examples/run_lm_finetuning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_lm_finetuning.py b/examples/run_lm_finetuning.py index dad9fab83fc..0115dcb98bf 100644 --- a/examples/run_lm_finetuning.py +++ b/examples/run_lm_finetuning.py @@ -57,7 +57,7 @@ class TextDataset(Dataset): def __init__(self, tokenizer, file_path='train', block_size=512): assert os.path.isfile(file_path) directory, filename = os.path.split(file_path) - cached_features_file = os.path.join(directory, 'cached_lm_{block_size}_{filename}') + cached_features_file = os.path.join(directory, 'cached_lm_{}_{}'.format(block_size, filename)) if os.path.exists(cached_features_file): logger.info("Loading features from cached file %s", cached_features_file)